1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

add or improve some debug messages (#6508)

This commit is contained in:
david gauchard 2019-09-12 16:08:52 +02:00 committed by GitHub
parent 0474eb9943
commit 2d1acfa9a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -32,6 +32,7 @@ size_t StreamString::write(const uint8_t *data, size_t size) {
*(wbuffer() + newlen) = 0x00; // add null for string end *(wbuffer() + newlen) = 0x00; // add null for string end
return size; return size;
} }
DEBUGV(":stream2string: OOM (%d->%d)\n", length(), newlen+1);
} }
return 0; return 0;
} }

View File

@ -1007,7 +1007,7 @@ const String& HTTPClient::getString(void)
_payload.reset(new StreamString()); _payload.reset(new StreamString());
if(_size) { if(_size > 0) {
// try to reserve needed memmory // try to reserve needed memmory
if(!_payload->reserve((_size + 1))) { if(!_payload->reserve((_size + 1))) {
DEBUG_HTTPCLIENT("[HTTP-Client][getString] not enough memory to reserve a string! need: %d\n", (_size + 1)); DEBUG_HTTPCLIENT("[HTTP-Client][getString] not enough memory to reserve a string! need: %d\n", (_size + 1));
@ -1456,10 +1456,10 @@ int HTTPClient::writeToStreamDataBlock(Stream * stream, int size)
free(buff); free(buff);
DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] connection closed or file end (written: %d).\n", bytesWritten); DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] end of chunk or data (transferred: %d).\n", bytesWritten);
if((size > 0) && (size != bytesWritten)) { if((size > 0) && (size != bytesWritten)) {
DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] bytesWritten %d and size %d mismatch!.\n", bytesWritten, size); DEBUG_HTTPCLIENT("[HTTP-Client][writeToStreamDataBlock] transferred size %d and request size %d mismatch!.\n", bytesWritten, size);
return HTTPC_ERROR_STREAM_WRITE; return HTTPC_ERROR_STREAM_WRITE;
} }