opt: log more info about the stream (#1858)
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run

* opt: log more info about the stream

* opt: log more info about the stream

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
xiaoyifang 2024-10-23 21:37:44 +08:00 committed by GitHub
parent 66a45f975e
commit c846c5d89b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 );