summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnectionchannel.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-23 09:24:00 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-23 09:40:54 +0200
commit32f50225c4913de1af145ef2da9a11ffffac3ded (patch)
treec2ecd51223706f3ad1234af883af9fdf33d846a2 /src/network/access/qhttpnetworkconnectionchannel.cpp
parent88e6f8cff2974c46b1262f3a1a61e1440c664e0c (diff)
parent9c58dd15885d813aeb5d83d2869c0f3a3ee5fcfe (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
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