From 967e9d6e285fbdffe52d026f1c81da071f50d68c Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Mon, 26 Mar 2012 11:49:55 +0200 Subject: QNAM: close the channel if bytesAvailable and nothing piplined If there are still bytesAvailable on the socket and we have nothing pipelined we should close the channel. This was not done before as the chunked decoder did not read the last CRLF. This has now been fixed so this close should be enabled again. Task-number: QTBUG-24875 Change-Id: I115b60f8d78bf1b83d3fd5887ab3eb9940b6bf00 Reviewed-by: Jonas Gastal Reviewed-by: Shane Kearns --- src/network/access/qhttpnetworkconnectionchannel.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index d4931bd207..6e33836feb 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -733,14 +733,8 @@ void QHttpNetworkConnectionChannel::allDone() } } else if (alreadyPipelinedRequests.isEmpty() && socket->bytesAvailable() > 0) { // this is weird. we had nothing pipelined but still bytes available. better close it. - //if (socket->bytesAvailable() > 0) - // close(); - // - // FIXME - // We do not close it anymore now, but should introduce this again after having fixed - // the chunked decoder in QHttpNetworkReply to read the whitespace after the last chunk. - // (Currently this is worked around by readStatus in the QHttpNetworkReply ignoring - // leading whitespace. + close(); + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } else if (alreadyPipelinedRequests.isEmpty()) { if (connectionCloseEnabled) -- cgit v1.2.3