diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-30 15:48:51 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-04-05 10:21:40 (GMT) |
commit | 989ca02a932cf7c90e8d29c18dd72415e46afb81 (patch) | |
tree | 65b0aac9fc3931eaa517b82c46b7ea93e80a278b | |
parent | e1f5699f262d52e72d6855440cfc1c2919b74163 (diff) | |
download | Qt-989ca02a932cf7c90e8d29c18dd72415e46afb81.zip Qt-989ca02a932cf7c90e8d29c18dd72415e46afb81.tar.gz Qt-989ca02a932cf7c90e8d29c18dd72415e46afb81.tar.bz2 |
Fix assert fail when debug log is enabled
Enough debug logging allows time for the proxy server to close the http
connection after sending a 407 response. This errors the connection,
but then the queued _q_startNextRequest is immediately run, causing an
assertion failure.
Changed this to a soft failure which allows the error to propagate
rather than crashing.
Test case is tst_qnetworkreply::ioPostToHttpFromSocket
Reviewed-by: Markus Goetz
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index a6d6172..6fbc6f8 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -842,7 +842,10 @@ void QHttpNetworkConnectionChannel::handleStatus() bool QHttpNetworkConnectionChannel::resetUploadData() { - Q_ASSERT(reply); + if (!reply) { + //this happens if server closes connection while QHttpNetworkConnectionPrivate::_q_startNextRequest is pending + return false; + } QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice(); if (!uploadByteDevice) return true; |