diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-01 18:41:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-07-01 18:41:14 +0200 |
commit | e6a94778d0c26b59e367e9f9fe4f401725fc9c4e (patch) | |
tree | c7597213d7eac14863bc3cfd7bccd247c8950710 /src/network/access/qnetworkreplyhttpimpl.cpp | |
parent | 605ba2c2268b2dce3d0b06899101d03a67e7f251 (diff) | |
parent | a09a8d509a69ed16d8afbe15296b8332cacd6c66 (diff) |
Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev
Diffstat (limited to 'src/network/access/qnetworkreplyhttpimpl.cpp')
-rw-r--r-- | src/network/access/qnetworkreplyhttpimpl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 3f546cf581..3ac8b8f56f 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -979,6 +979,9 @@ void QNetworkReplyHttpImplPrivate::initCacheSaveDevice() cacheSaveDevice = managerPrivate->networkCache->prepare(metaData); + if (cacheSaveDevice) + q->connect(cacheSaveDevice, SIGNAL(aboutToClose()), SLOT(_q_cacheSaveDeviceAboutToClose())); + if (!cacheSaveDevice || (cacheSaveDevice && !cacheSaveDevice->isOpen())) { if (cacheSaveDevice && !cacheSaveDevice->isOpen()) qCritical("QNetworkReplyImpl: network cache returned a device that is not open -- " @@ -1224,7 +1227,7 @@ void QNetworkReplyHttpImplPrivate::httpAuthenticationRequired(const QHttpNetwork void QNetworkReplyHttpImplPrivate::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator) { - managerPrivate->proxyAuthenticationRequired(proxy, synchronous, authenticator, &lastProxyAuthentication); + managerPrivate->proxyAuthenticationRequired(request.url(), proxy, synchronous, authenticator, &lastProxyAuthentication); } #endif @@ -1712,6 +1715,13 @@ void QNetworkReplyHttpImplPrivate::_q_bufferOutgoingDataFinished() QMetaObject::invokeMethod(q, "_q_startOperation", Qt::QueuedConnection); } +void QNetworkReplyHttpImplPrivate::_q_cacheSaveDeviceAboutToClose() +{ + // do not keep a dangling pointer to the device around (device + // is closing because e.g. QAbstractNetworkCache::remove() was called). + cacheSaveDevice = 0; +} + void QNetworkReplyHttpImplPrivate::_q_bufferOutgoingData() { Q_Q(QNetworkReplyHttpImpl); |