fix(httpc): Fix data read was less than expected (#9998)
This commit is contained in:
parent
6debc5c902
commit
60b6faacf6
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue