Skip to content

Commit 378c1f1

Browse files
authored
Update ESP8266HTTPClient.cpp (#7051)
sendRequest has a major problem when sending a big payload, the comparator in the IF loop has its two operators changed, so the last part of payload is never sent
1 parent a214180 commit 378c1f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,8 @@ int HTTPClient::sendRequest(const char * type, const uint8_t * payload, size_t s
681681
if (payload && size > 0) {
682682
size_t bytesWritten = 0;
683683
const uint8_t *p = payload;
684-
while (bytesWritten < size) {
684+
size_t originalSize = size;
685+
while (bytesWritten < originalSize) {
685686
int written;
686687
int towrite = std::min((int)size, (int)HTTP_TCP_BUFFER_SIZE);
687688
written = _client->write(p + bytesWritten, towrite);

0 commit comments

Comments
 (0)