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

better bytesWritten accounting in sendRequest and writeToStream

This commit is contained in:
George Talusan 2015-12-23 11:29:59 -05:00
parent dd93ea26ee
commit 1e264047f9

View File

@ -368,11 +368,11 @@ int HTTPClient::sendRequest(const char * type, Stream * stream, size_t size) {
// write it to Stream
int w = _tcp->write((const uint8_t *) buff, c);
bytesWritten += w;
if(w != c) {
DEBUG_HTTPCLIENT("[HTTP-Client][sendRequest] short write asked for %d but got %d\n", c, w);
break;
}
bytesWritten += c;
if(len > 0) {
len -= c;
@ -480,11 +480,11 @@ int HTTPClient::writeToStream(Stream * stream) {
// write it to Stream
int w = stream->write(buff, c);
bytesWritten += w;
if(w != c) {
DEBUG_HTTPCLIENT("[HTTP-Client][writeToStream] short write asked for %d but got %d\n", c, w);
break;
}
bytesWritten += c;
if(len > 0) {
len -= c;