File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ void QHttpConnection::waitForBytesWritten()
126126 m_socket->waitForBytesWritten ();
127127}
128128
129+ book QHttpConnection::isOpen ()
130+ {
131+ return m_socket->isOpen ();
132+ }
133+
129134void QHttpConnection::responseDone ()
130135{
131136 QHttpResponse *response = qobject_cast<QHttpResponse *>(QObject::sender ());
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class QHTTPSERVER_API QHttpConnection : public QObject
4141 void write (const QByteArray &data);
4242 void flush ();
4343 void waitForBytesWritten ();
44+ bool isOpen ();
4445
4546Q_SIGNALS :
4647 void newRequest (QHttpRequest *, QHttpResponse *);
Original file line number Diff line number Diff line change @@ -171,6 +171,11 @@ void QHttpResponse::waitForBytesWritten()
171171 m_connection->waitForBytesWritten ();
172172}
173173
174+ bool QHttpResponse::isOpen ()
175+ {
176+ return m_connection->isOpen ();
177+ }
178+
174179void QHttpResponse::end (const QByteArray &data)
175180{
176181 if (m_finished) {
Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ public Q_SLOTS:
121121 /* * @note writeHead() must be called before this function. */
122122 void waitForBytesWritten ();
123123
124+ // / Check if connection is open to allow transmition
125+ bool isOpen ();
126+
124127 // / End/finish the response.
125128 /* * Data will be flushed to the underlying socket
126129 and the connection itself will be closed if
You can’t perform that action at this time.
0 commit comments