summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnectionchannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 52dd86cd1e..2dc3f80998 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -607,8 +607,14 @@ void QHttpNetworkConnectionChannel::handleStatus()
if (redirectUrl.isValid())
reply->setRedirectUrl(redirectUrl);
- if (qobject_cast<QHttpNetworkConnection *>(connection))
+ if ((statusCode == 307 || statusCode == 308) && !resetUploadData()) {
+ // Couldn't reset the upload data, which means it will be unable to POST the data -
+ // this would lead to a long wait until it eventually failed and then retried.
+ // Instead of doing that we fail here instead, resetUploadData will already have emitted
+ // a ContentReSendError, so we're done.
+ } else if (qobject_cast<QHttpNetworkConnection *>(connection)) {
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ }
break;
}
case 401: // auth required