summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2015-01-05 14:00:20 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-01-09 11:16:54 +0100
commit7bd3d4591a126cd99f797f1a9f83c966547e29e1 (patch)
treea902941f97c242843a375997ab02963f1a2c521a /src/network
parentde61130bd48e2a028fea9bd408703805e41fb05b (diff)
Fix authenticated POST/PUT http requests with buffering disabled
If reset is disabled then POST and PUT requests can not be authenticated as the upload device can not be reset. There shouldn't be any reason that shouldn't be allowed if the QIODevice given supports resetting. The disableReset feature of QNonContiguousByteDevice is removed as it is not used anywhere else, and is redundant when reset can indicate success or failure. Task-number: QTBUG-43628 Change-Id: If941a98fd3f797872351c10bdca6aa6745dbefea Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp6
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp8
2 files changed, 0 insertions, 14 deletions
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index a4067daf49..f879136163 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -129,12 +129,6 @@ QNonContiguousByteDevice* QNetworkAccessBackend::createUploadByteDevice()
return 0;
}
- bool bufferDisallowed =
- reply->request.attribute(QNetworkRequest::DoNotBufferUploadDataAttribute,
- QVariant(false)) == QVariant(true);
- if (bufferDisallowed)
- uploadByteDevice->disableReset();
-
// We want signal emissions only for normal asynchronous uploads
if (!isSynchronous())
connect(uploadByteDevice.data(), SIGNAL(readProgress(qint64,qint64)), this, SLOT(emitReplyUploadProgress(qint64,qint64)));
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 48270b1f91..e7c1b61d4d 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -856,8 +856,6 @@ void QNetworkReplyHttpImplPrivate::postRequest()
if (uploadByteDevice) {
QNonContiguousByteDeviceThreadForwardImpl *forwardUploadDevice =
new QNonContiguousByteDeviceThreadForwardImpl(uploadByteDevice->atEnd(), uploadByteDevice->size());
- if (uploadByteDevice->isResetDisabled())
- forwardUploadDevice->disableReset();
forwardUploadDevice->setParent(delegate); // needed to make sure it is moved on moveToThread()
delegate->httpRequest.setUploadByteDevice(forwardUploadDevice);
@@ -1896,12 +1894,6 @@ QNonContiguousByteDevice* QNetworkReplyHttpImplPrivate::createUploadByteDevice()
return 0;
}
- bool bufferDisallowed =
- request.attribute(QNetworkRequest::DoNotBufferUploadDataAttribute,
- QVariant(false)) == QVariant(true);
- if (bufferDisallowed)
- uploadByteDevice->disableReset();
-
// We want signal emissions only for normal asynchronous uploads
if (!synchronous)
QObject::connect(uploadByteDevice.data(), SIGNAL(readProgress(qint64,qint64)),