diff options
Diffstat (limited to 'src/network/access/qnetworkreplyhttpimpl.cpp')
-rw-r--r-- | src/network/access/qnetworkreplyhttpimpl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 2af23a4eb5..a021d51952 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -424,6 +424,7 @@ QNetworkReplyHttpImplPrivate::QNetworkReplyHttpImplPrivate() , synchronous(false) , state(Idle) , statusCode(0) + , uploadDeviceChoking(false) , outgoingData(0) , bytesUploaded(-1) , cacheLoadDevice(0) @@ -1285,9 +1286,12 @@ void QNetworkReplyHttpImplPrivate::wantUploadDataSlot(qint64 maxSize) char *data = const_cast<char*>(uploadByteDevice->readPointer(maxSize, currentUploadDataLength)); if (currentUploadDataLength == 0) { + uploadDeviceChoking = true; // No bytes from upload byte device. There will be bytes later, it will emit readyRead() // and our uploadByteDeviceReadyReadSlot() is called. return; + } else { + uploadDeviceChoking = false; } // Let's make a copy of this data @@ -1300,7 +1304,12 @@ void QNetworkReplyHttpImplPrivate::wantUploadDataSlot(qint64 maxSize) void QNetworkReplyHttpImplPrivate::uploadByteDeviceReadyReadSlot() { // Start the flow between this thread and the HTTP thread again by triggering a upload. - wantUploadDataSlot(1024); + // However only do this when we were choking before, else the state in + // QNonContiguousByteDeviceThreadForwardImpl gets messed up. + if (uploadDeviceChoking) { + uploadDeviceChoking = false; + wantUploadDataSlot(1024); + } } |