summaryrefslogtreecommitdiff
path: root/lib/inets/src/http_client
diff options
context:
space:
mode:
authorKiko Fernandez-Reyes <kiko@erlang.org>2023-02-20 15:48:42 +0100
committerKiko Fernandez-Reyes <kiko@erlang.org>2023-02-20 15:48:42 +0100
commit628a2b4b1738b1ccb385d164a62bb576d11b6de4 (patch)
tree655e4199aa01e9afde43e670c3e02a41cc7f9730 /lib/inets/src/http_client
parent3d372f9486e6db13a5e42977f21cde6b3a31e0fe (diff)
downloaderlang-628a2b4b1738b1ccb385d164a62bb576d11b6de4.tar.gz
inets: refactor code to improve readability
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index 1868d9351a..6d4d198350 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -622,17 +622,12 @@ do_handle_info({ssl_closed, _}, State = #state{request = undefined}) ->
{stop, normal, State};
%%% Error cases
-do_handle_info({tcp_closed, _}, #state{session = #session{socket = Socket}=Session0} = State) ->
+do_handle_info({Closed, _}, #state{session = #session{socket = Socket}=Session0} = State)
+ when Closed == tcp_closed; Closed == ssl_closed ->
Session = Session0#session{socket = {remote_close, Socket}},
%% {stop, session_remotly_closed, State};
{stop, normal, State#state{session = Session}};
-do_handle_info({ssl_closed, _}, #state{session = #session{socket = Socket}=Session0} = State) ->
- Session = Session0#session{socket = {remote_close, Socket}},
- %% {stop, session_remotly_closed, State};
- {stop, normal, State#state{session = Session}};
-do_handle_info({tcp_error, _, _} = Reason, State) ->
- {stop, Reason, State};
-do_handle_info({ssl_error, _, _} = Reason, State) ->
+do_handle_info({Error, _, _} = Reason, State) when Error == tcp_error; Error == ssl_error ->
{stop, Reason, State};
%% Timeouts