Skip to content

Commit 6bd3274

Browse files
authored
fix(httpc): Fix data read was less than expected (#10019)
1 parent 33c9552 commit 6bd3274

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/HTTPClient/src/HTTPClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ int HTTPClient::writeToStreamDataBlock(Stream * stream, int size)
14231423
// some time for the stream
14241424
delay(1);
14251425

1426-
int leftBytes = (readBytes - bytesWrite);
1426+
int leftBytes = (bytesRead - bytesWrite);
14271427

14281428
// retry to send the missed bytes
14291429
bytesWrite = stream->write((buff + bytesWrite), leftBytes);
@@ -1446,7 +1446,7 @@ int HTTPClient::writeToStreamDataBlock(Stream * stream, int size)
14461446

14471447
// count bytes to read left
14481448
if(len > 0) {
1449-
len -= readBytes;
1449+
len -= bytesRead;
14501450
}
14511451

14521452
delay(0);

0 commit comments

Comments
 (0)