Unverified Commit 60b6faac authored by Me No Dev's avatar Me No Dev Committed by GitHub

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

parent 6debc5c9
...@@ -1362,7 +1362,7 @@ int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) { ...@@ -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) { ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment