summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-04 12:37:18 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-02-04 12:37:18 (GMT)
commit8f83747d12efc612b730a7dd911f916127387c0c (patch)
treed61b4c877cd14247ae0de260034cb99494434c5d /src/network/access
parent53038b678ccba374da5ce9ad216044f075a3ffd8 (diff)
parent8e98033a67263f6a2d9155f228dc28e2faee4f5e (diff)
downloadQt-8f83747d12efc612b730a7dd911f916127387c0c.zip
Qt-8f83747d12efc612b730a7dd911f916127387c0c.tar.gz
Qt-8f83747d12efc612b730a7dd911f916127387c0c.tar.bz2
Merge remote branch 'origin/4.6' into qt-master-from-4.6
Conflicts: examples/assistant/simpletextviewer/findfiledialog.cpp qmake/generators/symbian/symmake.cpp tools/assistant/lib/qhelpgenerator.cpp tools/assistant/lib/qhelpsearchquerywidget.cpp translations/translations.pri
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp8
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp27
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h2
3 files changed, 27 insertions, 10 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index fff7097..cc6a1c8 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -688,8 +688,14 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
if (channels[i].resendCurrent) {
channels[i].resendCurrent = false;
channels[i].state = QHttpNetworkConnectionChannel::IdleState;
- if (channels[i].reply)
+ if (channels[i].reply) {
+
+ // if this is not possible, error will be emitted and connection terminated
+ if (!channels[i].resetUploadData())
+ continue;
+
channels[i].sendRequest();
+ }
}
}
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
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index c30c236..75ab50d 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -151,6 +151,8 @@ public:
void allDone(); // reply header + body have been read
void handleStatus(); // called from allDone()
+ bool resetUploadData(); // return true if resetting worked or there is no upload data
+
void pipelineInto(HttpMessagePair &pair);
void requeueCurrentlyPipelinedRequests();
void detectPipeliningSupport();