diff --git a/src/article_netmgr.cc b/src/article_netmgr.cc index ee820eff..53d08962 100644 --- a/src/article_netmgr.cc +++ b/src/article_netmgr.cc @@ -380,14 +380,21 @@ qint64 ArticleResourceReply::readData( char * out, qint64 maxSize ) return finished ? -1 : 0; } - qint64 const left = avail - alreadyRead; qint64 const toRead = maxSize < left ? maxSize : left; if ( !toRead && finished ) { return -1; } - GD_DPRINTF( "====reading %d of (%lld) bytes . Finished: %d", (int)toRead, avail, finished ); + if ( toRead == 0 ) { + return 0; + } + + GD_DPRINTF( "====reading %lld of (%lld) bytes, %lld bytes readed . Finish status: %d", + toRead, + avail, + alreadyRead, + finished ); try { req->getDataSlice( alreadyRead, toRead, out );