aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client/httpc_handler.erl
diff options
context:
space:
mode:
authorMarcus Arendt <[email protected]>2014-05-22 10:40:00 +0200
committerMarcus Arendt <[email protected]>2014-05-22 10:40:00 +0200
commit97ec79ab4ab2e00de42e69534b0181eeccbadfc8 (patch)
tree4d99c17327cf45f7c27d7b0ff336c5f08626f623 /lib/inets/src/http_client/httpc_handler.erl
parentf64c39daeff68af63b1864bf11313d566768a37f (diff)
parentcf3c624dc66a42d9d7bec904d8be3b8c4cce38ae (diff)
downloadotp-97ec79ab4ab2e00de42e69534b0181eeccbadfc8.tar.gz
otp-97ec79ab4ab2e00de42e69534b0181eeccbadfc8.tar.bz2
otp-97ec79ab4ab2e00de42e69534b0181eeccbadfc8.zip
Merge branch 'scrapinghub/stream_for_chunked_single_message' into maint
* scrapinghub/stream_for_chunked_single_message: inets: Fix streaming with single chunk body
Diffstat (limited to 'lib/inets/src/http_client/httpc_handler.erl')
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index 88e08be789..612eb05358 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -1116,8 +1116,16 @@ handle_http_body(Body, #state{headers = Headers,
{new_body, NewBody}]),
NewHeaders = http_chunk:handle_headers(Headers,
ChunkedHeaders),
- handle_response(State#state{headers = NewHeaders,
- body = NewBody})
+ case Body of
+ <<>> ->
+ handle_response(State#state{headers = NewHeaders,
+ body = NewBody});
+ _ ->
+ {NewBody2, NewRequest} =
+ stream(NewBody, Request, Code),
+ handle_response(State#state{headers = NewHeaders,
+ body = NewBody2})
+ end
end;
Enc when Enc =:= "identity"; Enc =:= undefined ->
?hcrt("handle_http_body - identity", []),