summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnectionchannel.cpp
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-01-29 10:12:48 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-02-03 09:22:17 (GMT)
commit4f97685cef49fea0ea0614b6972241c497b4b1a2 (patch)
treecdc9b32642732e7b1261bde80d59e729515c3e93 /src/network/access/qhttpnetworkconnectionchannel.cpp
parentd5a3866d20507967e14ed34930f08ce6248000e5 (diff)
downloadQt-4f97685cef49fea0ea0614b6972241c497b4b1a2.zip
Qt-4f97685cef49fea0ea0614b6972241c497b4b1a2.tar.gz
Qt-4f97685cef49fea0ea0614b6972241c497b4b1a2.tar.bz2
QNAM HTTP: Fix bug related to re-sending a request
Thanks Nils Jeisecke for report and proposed fix. Task-number: QTBUG-7713 Reviewed-by: thiago
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index b80ae9a..70a301d 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -674,15 +674,8 @@ void QHttpNetworkConnectionChannel::handleStatus()
case 407: // proxy auth required
if (connection->d_func()->handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend)) {
if (resend) {
- QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice();
- if (uploadByteDevice) {
- if (uploadByteDevice->reset()) {
- written = 0;
- } else {
- connection->d_func()->emitReplyError(socket, reply, QNetworkReply::ContentReSendError);
- break;
- }
- }
+ if (!resetUploadData())
+ break;
reply->d_func()->eraseData();
@@ -712,6 +705,22 @@ void QHttpNetworkConnectionChannel::handleStatus()
}
}
+bool QHttpNetworkConnectionChannel::resetUploadData()
+{
+ QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice();
+ if (!uploadByteDevice)
+ return true;
+
+ if (uploadByteDevice->reset()) {
+ written = 0;
+ return true;
+ } else {
+ connection->d_func()->emitReplyError(socket, reply, QNetworkReply::ContentReSendError);
+ return false;
+ }
+}
+
+
void QHttpNetworkConnectionChannel::pipelineInto(HttpMessagePair &pair)
{
// this is only called for simple GET