QHttpNetworkReply:readBodyFast return early if nothing to read.

Incase there is no bytesAvailable on the socket there is no need to
try to read.

Change-Id: Ied9e4b8d86854b356a733fab4948739db206b6ad
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
Martin Petersson 2012-05-09 14:07:32 +02:00 committed by Qt by Nokia
parent 7ba7dddffd
commit 384c155627

View File

@ -620,6 +620,8 @@ qint64 QHttpNetworkReplyPrivate::readBodyFast(QAbstractSocket *socket, QByteData
if (readBufferMaxSize)
toBeRead = qMin(toBeRead, readBufferMaxSize);
if (!toBeRead)
return 0;
QByteArray bd;
bd.resize(toBeRead);