Skip to content

add or improve some debug messages #6508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cores/esp8266/StreamString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ size_t StreamString::write(const uint8_t *data, size_t size) {
*(wbuffer() + newlen) = 0x00; // add null for string end
return size;
}
DEBUGV(":stream2string: OOM (%d->%d)\n", length(), newlen+1);
}
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ const String& HTTPClient::getString(void)

_payload.reset(new StreamString());

if(_size) {
if(_size > 0) {
// try to reserve needed memmory
if(!_payload->reserve((_size + 1))) {
DEBUG_HTTPCLIENT("[HTTP-Client][getString] not enough memory to reserve a string! need: %d\n", (_size + 1));
Expand Down Expand Up @@ -1456,10 +1456,10 @@ int HTTPClient::writeToStreamDataBlock(Stream * stream, int size)

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)) {
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;
}

Expand Down