fix(httpc): Fix data read was less than expected (#9998)

This commit is contained in:
Me No Dev 2024-07-10 13:49:09 +03:00 committed by GitHub
parent 6debc5c902
commit 60b6faacf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1362,7 +1362,7 @@ int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) {
// some time for the stream // some time for the stream
delay(1); delay(1);
int leftBytes = (readBytes - bytesWrite); int leftBytes = (bytesRead - bytesWrite);
// retry to send the missed bytes // retry to send the missed bytes
bytesWrite = stream->write((buff + bytesWrite), leftBytes); bytesWrite = stream->write((buff + bytesWrite), leftBytes);
@ -1385,7 +1385,7 @@ int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) {
// count bytes to read left // count bytes to read left
if (len > 0) { if (len > 0) {
len -= readBytes; len -= bytesRead;
} }
delay(0); delay(0);