-
Notifications
You must be signed in to change notification settings - Fork 13.3k
HTTPclient - add CHUNKED encoding support #1333
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
Conversation
HTTP Client - fix examples increase default timeout to 5000ms
Seems to have made things a bit unstable..
|
Still size -1 though. this will not fix that though correct? only the insertion of the length sent into the content |
(4.00GB required) sounds wrong to me. enabling DEBUG_HTTPCLIENT may also give more info. |
len = (uint32_t) strtol((const char *) chunkHeader.c_str(), NULL, 16); | ||
DEBUG_HTTPCLIENT("[HTTP-Client] read chunk len: %d\n", len); | ||
if(len > 0) { | ||
int r = writeToStreamDataBlock(stream, len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this check if r != len to handle short writes? If there's a short write then it looks like this'll continue to iterate over the response.
the 4GB is because i was using size_t as value for http.getsize(), not realising that it can be negative. So -1 was obviously falling back to some really large number... not a biggy |
add retry for short write remove compiler warnings
@gtalusan short write now have its own error (HTTPC_ERROR_STREAM_WRITE) no need to detect it in the application any more. |
use HTTP/1.0 for update since the update handler not support any transfer Encoding
0f01863
to
1ab74c1
Compare
Awesome! |
HTTPclient - add CHUNKED encoding support
This is HTTP client so when connecting to NOT ESP8266WebServer (so not always get Connection: close) there has to be chunking implemented... |
oh, sorry, my bad. |
#1324