diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-06-18 13:33:14 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-06-18 13:33:14 (GMT) |
commit | 8675a8915d09d0ca2091c606345a2d99f642949b (patch) | |
tree | 4768c058bc33f624015030f990444b493ae553fb | |
parent | 747c7a9a060267dee9622c96bf0e2a54147dacfa (diff) | |
download | Qt-8675a8915d09d0ca2091c606345a2d99f642949b.zip Qt-8675a8915d09d0ca2091c606345a2d99f642949b.tar.gz Qt-8675a8915d09d0ca2091c606345a2d99f642949b.tar.bz2 |
QNAM HTTP code: Do not close TCP connection in all cases
This makes sure the keep-alive connections stay open even
if someone deletes a QNetworkReply which will then go all the
way down to removeReply(QHttpNetworkReply).
Should fix
http://lists.trolltech.com/pipermail/qt-interest/2009-June/007777.html
Reviewed-by: Peter Hartmann
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index f698c71..4c08794 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -937,7 +937,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) for (int i = 0; i < channelCount; ++i) { if (channels[i].reply == reply) { channels[i].reply = 0; - closeChannel(i); + if (reply->d_func()->connectionCloseEnabled()) + closeChannel(i); QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); return; } |