Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-http by
Diff: source/http_response.h
- Revision:
- 14:3004056e4661
- Parent:
- 9:1289162d9530
- Child:
- 15:ffc77f212382
diff -r 992d953ecfb9 -r 3004056e4661 source/http_response.h --- a/source/http_response.h Thu Mar 30 12:53:43 2017 +0200 +++ b/source/http_response.h Thu Mar 30 15:13:37 2017 +0200 @@ -111,6 +111,11 @@ } void set_body(const char *at, size_t length) { + // Connection: close, could not specify Content-Length, nor chunked... So do it like this: + if (expected_content_length == 0 && length > 0) { + is_chunked = true; + } + // only malloc when this fn is called, so we don't alloc when body callback's are enabled if (body == NULL && !is_chunked) { body = (char*)malloc(expected_content_length);