From 7bd3d4591a126cd99f797f1a9f83c966547e29e1 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 5 Jan 2015 14:00:20 +0100 Subject: 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 --- src/network/access/qnetworkaccessbackend.cpp | 6 ------ src/network/access/qnetworkreplyhttpimpl.cpp | 8 -------- 2 files changed, 14 deletions(-) (limited to 'src/network') 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)), -- cgit v1.2.3