1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

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
This commit is contained in:
ramirocarra 2020-02-01 20:11:00 -03:00 committed by GitHub
parent a2141803f1
commit 378c1f14c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -681,7 +681,8 @@ int HTTPClient::sendRequest(const char * type, const uint8_t * payload, size_t s
if (payload && size > 0) {
size_t bytesWritten = 0;
const uint8_t *p = payload;
while (bytesWritten < size) {
size_t originalSize = size;
while (bytesWritten < originalSize) {
int written;
int towrite = std::min((int)size, (int)HTTP_TCP_BUFFER_SIZE);
written = _client->write(p + bytesWritten, towrite);