aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorZandra <[email protected]>2015-11-20 10:22:56 +0100
committerZandra <[email protected]>2015-11-20 10:22:56 +0100
commit48f72c4967b3fd39b7b63898f4b24a72186b6dc8 (patch)
treeee0f8b30418bb85bf2a4c448aa6a5ecefc31297d /lib/inets/src
parentb190a53c020def1e72e49e30c66ccae822208eee (diff)
parent94ea0c1218cfb8480d37775f0c2a82452c897360 (diff)
downloadotp-48f72c4967b3fd39b7b63898f4b24a72186b6dc8.tar.gz
otp-48f72c4967b3fd39b7b63898f4b24a72186b6dc8.tar.bz2
otp-48f72c4967b3fd39b7b63898f4b24a72186b6dc8.zip
Merge branch 'maint'
Diffstat (limited to 'lib/inets/src')
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index 1044cffe6f..e6dcfee818 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -1113,8 +1113,8 @@ handle_http_body(Body, #state{headers = Headers,
case case_insensitive_header(TransferEnc) of
"chunked" ->
?hcrt("handle_http_body - chunked", []),
- case http_chunk:decode(Body, State#state.max_body_size,
- State#state.max_header_size) of
+ try http_chunk:decode(Body, State#state.max_body_size,
+ State#state.max_header_size) of
{Module, Function, Args} ->
?hcrt("handle_http_body - new mfa",
[{module, Module},
@@ -1139,6 +1139,13 @@ handle_http_body(Body, #state{headers = Headers,
handle_response(State#state{headers = NewHeaders,
body = NewBody2})
end
+ catch throw:{error, Reason} ->
+ NewState =
+ answer_request(Request,
+ httpc_response:error(Request,
+ Reason),
+ State),
+ {stop, normal, NewState}
end;
Enc when Enc =:= "identity"; Enc =:= undefined ->
?hcrt("handle_http_body - identity", []),