diff options
author | Marcus Arendt <[email protected]> | 2014-06-04 13:19:16 +0200 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-06-04 13:19:16 +0200 |
commit | f29a78c97709ad94a4255fb5b2566b3a1b3af933 (patch) | |
tree | 4f9cec0f8b49f5192fd7c27fad3b2cad41fd2ae3 /lib/inets/src/http_client | |
parent | 596f214fc0275df8b19a8b36bb7b71e6affc6bd5 (diff) | |
parent | a027c412d7cb6cf6ad00422b7dfd8534bf8c212b (diff) | |
download | otp-f29a78c97709ad94a4255fb5b2566b3a1b3af933.tar.gz otp-f29a78c97709ad94a4255fb5b2566b3a1b3af933.tar.bz2 otp-f29a78c97709ad94a4255fb5b2566b3a1b3af933.zip |
Merge branch 'scrapinghub/stream_body_with_no_content_length' into maint
* scrapinghub/stream_body_with_no_content_length:
inets: Fix HTTP 1.0 body end on closed connection
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index 612eb05358..5ae6760f08 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1226,6 +1226,7 @@ handle_response(#state{request = Request, handle_queue(State#state{request = undefined}, Data); {ok, Msg, Data} -> ?hcrd("handle response - ok", []), + stream_remaining_body(Body, Request, StatusLine), end_stream(StatusLine, Request), NewState = maybe_send_answer(Request, Msg, State), handle_queue(NewState, Data); @@ -1656,6 +1657,10 @@ start_stream(_StatusLine, _Headers, Request) -> ?hcrt("start stream - no op", []), {ok, Request}. +stream_remaining_body(<<>>, _, _) -> + ok; +stream_remaining_body(Body, Request, {_, Code, _}) -> + stream(Body, Request, Code). %% Note the end stream message is handled by httpc_response and will %% be sent by answer_request |