From 8675a8915d09d0ca2091c606345a2d99f642949b Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 18 Jun 2009 15:33:14 +0200 Subject: 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 --- src/network/access/qhttpnetworkconnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v0.12