aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client/httpc.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-10-14 13:50:32 +0200
committerIngela Anderton Andin <[email protected]>2013-10-14 13:50:32 +0200
commitdb460f90313bb7adea4ebd4cf0f3cca568ddf118 (patch)
tree04c9a60a9afa9a4d0dfadf96b152349ca00e94ad /lib/inets/src/http_client/httpc.erl
parentf13b2362c665ef2d98858a4601b1fecf31a21bb5 (diff)
parentcee5e8344470904f98579fae7046f49d65dbcb33 (diff)
downloadotp-db460f90313bb7adea4ebd4cf0f3cca568ddf118.tar.gz
otp-db460f90313bb7adea4ebd4cf0f3cca568ddf118.tar.bz2
otp-db460f90313bb7adea4ebd4cf0f3cca568ddf118.zip
Merge branch 'ia/inets/http-client-cancel-request/OTP-11312' into maint
* ia/inets/http-client-cancel-request/OTP-11312: inets: httpc - Remove dead error handling code inets: httpc make httpc_cancel_request/[1,2] asynchronous httpc: Enhanched error handling inets: httpc improve pipelining
Diffstat (limited to 'lib/inets/src/http_client/httpc.erl')
-rw-r--r--lib/inets/src/http_client/httpc.erl23
1 files changed, 3 insertions, 20 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index 4d7023a8e9..da9bbdd1ec 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -208,16 +208,8 @@ cancel_request(RequestId) ->
cancel_request(RequestId, Profile)
when is_atom(Profile) orelse is_pid(Profile) ->
?hcrt("cancel request", [{request_id, RequestId}, {profile, Profile}]),
- ok = httpc_manager:cancel_request(RequestId, profile_name(Profile)),
- receive
- %% If the request was already fulfilled throw away the
- %% answer as the request has been canceled.
- {http, {RequestId, _}} ->
- ok
- after 0 ->
- ok
- end.
-
+ httpc_manager:cancel_request(RequestId, profile_name(Profile)).
+
%%--------------------------------------------------------------------------
%% set_options(Options) -> ok | {error, Reason}
@@ -241,14 +233,7 @@ set_options(Options, Profile) when is_atom(Profile) orelse is_pid(Profile) ->
?hcrt("set options", [{options, Options}, {profile, Profile}]),
case validate_options(Options) of
{ok, Opts} ->
- try
- begin
- httpc_manager:set_options(Opts, profile_name(Profile))
- end
- catch
- exit:{noproc, _} ->
- {error, inets_not_started}
- end;
+ httpc_manager:set_options(Opts, profile_name(Profile));
{error, Reason} ->
{error, Reason}
end.
@@ -343,8 +328,6 @@ store_cookies(SetCookieHeaders, Url, Profile)
ok
end
catch
- exit:{noproc, _} ->
- {error, {not_started, Profile}};
error:{badmatch, Bad} ->
{error, {parse_failed, Bad}}
end.