Skip to content

Commit 60b6faa

Browse files
authored
fix(httpc): Fix data read was less than expected (espressif#9998)
1 parent 6debc5c commit 60b6faa

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
@@ -1362,7 +1362,7 @@ int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) {
13621362
// some time for the stream
13631363
delay(1);
13641364

1365-
int leftBytes = (readBytes - bytesWrite);
1365+
int leftBytes = (bytesRead - bytesWrite);
13661366

13671367
// retry to send the missed bytes
13681368
bytesWrite = stream->write((buff + bytesWrite), leftBytes);
@@ -1385,7 +1385,7 @@ int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) {
13851385

13861386
// count bytes to read left
13871387
if (len > 0) {
1388-
len -= readBytes;
1388+
len -= bytesRead;
13891389
}
13901390

13911391
delay(0);

0 commit comments

Comments
 (0)