QHttpNetworkConnectionChannel: Warn if bytesAvailable and no reply
authorMartin Petersson <Martin.Petersson@nokia.com>
Wed, 14 Mar 2012 09:44:31 +0000 (10:44 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 14 Mar 2012 23:50:47 +0000 (00:50 +0100)
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: Ifbb1f4732d3173a7807ac5bd0dc78fb5144faaf3
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
src/network/access/qhttpnetworkconnectionchannel.cpp

index a009222..d4931bd 100644 (file)
@@ -357,9 +357,9 @@ 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;
     }