Skip to content

Commit 8269510

Browse files
committed
Optionally store all body data in the request
1 parent a32f70e commit 8269510

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

src/qhttpconnection.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,6 @@ void QHttpConnection::flush()
105105
m_socket->flush();
106106
}
107107

108-
void QHttpConnection::responseDone()
109-
{
110-
QHttpResponse *response = qobject_cast<QHttpResponse*>(QObject::sender());
111-
if( response->m_last )
112-
{
113-
m_socket->disconnectFromHost();
114-
}
115-
}
116-
117108
/********************
118109
* Static Callbacks *
119110
*******************/
@@ -148,6 +139,7 @@ int QHttpConnection::HeadersComplete(http_parser *parser)
148139
else {
149140
// TODO: abort with 400
150141
}
142+
151143
theConnection->m_request->setHeaders(theConnection->m_currentHeaders);
152144

153145
/** set client information **/
@@ -159,7 +151,6 @@ int QHttpConnection::HeadersComplete(http_parser *parser)
159151
response->m_keepAlive = false;
160152

161153
connect(theConnection, SIGNAL(destroyed()), response, SLOT(connectionClosed()));
162-
connect(response, SIGNAL(done()), theConnection, SLOT(responseDone()));
163154

164155
// we are good to go!
165156
emit theConnection->newRequest(theConnection->m_request, response);

src/qhttpconnection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class QHttpConnection : public QObject
5151

5252
private slots:
5353
void parseRequest();
54-
void responseDone();
5554
void socketDisconnected();
5655

5756
private:

src/qhttprequest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class QHttpRequest : public QObject
221221
void setVersion(const QString &version) { m_version = version; }
222222
void setUrl(const QUrl &url) { m_url = url; }
223223
void setHeaders(const HeaderHash headers) { m_headers = headers; }
224-
void setSuccessful(bool success) { m_succes = success; }
224+
void setSuccessful(bool success) { m_success = success; }
225225

226226
QHttpConnection *m_connection;
227227
HeaderHash m_headers;
@@ -231,7 +231,7 @@ class QHttpRequest : public QObject
231231
QString m_remoteAddress;
232232
quint16 m_remotePort;
233233
QByteArray m_body;
234-
bool m_succes;
234+
bool m_success;
235235

236236
friend class QHttpConnection;
237237

0 commit comments

Comments
 (0)