summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-03-07 12:08:02 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-04-05 13:43:57 (GMT)
commitba166b618e2360d2fa7e927adf239d737a443f5a (patch)
tree32b839d70424dd6c1078e34e9d469311a5b804b3 /src/network
parent72bf355b037648029a76cf7923e3f529c909f21a (diff)
downloadQt-ba166b618e2360d2fa7e927adf239d737a443f5a.zip
Qt-ba166b618e2360d2fa7e927adf239d737a443f5a.tar.gz
Qt-ba166b618e2360d2fa7e927adf239d737a443f5a.tar.bz2
Call wait() after calling quit() so that it can gracefully finish
There was a problem with slow https connections that if the download was ongoing when quit() was called then it tended to cause a crash because it tries to shutdown the SSL connection. Task-number: QTBUG-24594 Change-Id: I6b161bc7a9bb99e41849537462de2d7c92661902 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com> (cherry picked from commit 46c58502639c25e5d19dd84d913b1208d5051db5)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp1
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 14963d0..db2b83e 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -668,6 +668,7 @@ void QNetworkAccessHttpBackend::postRequest()
// End the thread. It will delete itself from the finished() signal
thread->quit();
+ thread->wait(5000);
finished();
} else {
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 58690fa..6e49c11 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1152,6 +1152,7 @@ void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager)
if (manager->d_func()->httpThread) {
// The thread will deleteLater() itself from its finished() signal
manager->d_func()->httpThread->quit();
+ manager->d_func()->httpThread->wait(5000);
manager->d_func()->httpThread = 0;
}
}
@@ -1161,6 +1162,7 @@ QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()
if (httpThread) {
// The thread will deleteLater() itself from its finished() signal
httpThread->quit();
+ httpThread->wait(5000);
httpThread = 0;
}
}