From 67aa52dfe8496135290bdcca9ac252ba5623ad1c Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Mon, 23 Apr 2012 12:12:18 +0200 Subject: QHttpNetworkConnectionChannel: Warn if bytesAvailable and no reply If there are no bytesAvailable and no reply then the channel can be closed without any need for this warning. Task-number: QTBUG-9315 Change-Id: Idd461a38ea932305cc227dbd68b9af61b7e855d2 Reviewed-by: Shane Kearns --- src/network/access/qhttpnetworkconnectionchannel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/network/access') diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index ff6f8a05a2..3540942944 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -336,9 +336,10 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() Q_ASSERT(socket); if (!reply) { - // heh, how should that happen! - qWarning() << "QHttpNetworkConnectionChannel::_q_receiveReply() called without QHttpNetworkReply," - << socket->bytesAvailable() << "bytes on socket."; + if (socket->bytesAvailable() > 0) + qWarning() << "QHttpNetworkConnectionChannel::_q_receiveReply() called without QHttpNetworkReply," + << socket->bytesAvailable() << "bytes on socket."; + close(); return; } -- cgit v1.2.1