aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-03-02 11:25:46 +0100
committerIngela Anderton Andin <[email protected]>2016-03-02 11:25:46 +0100
commit01793d6e6b4e194d667cd31cb64e21af562b48f3 (patch)
treeecb9a80705aa3748dcb507a1eee52ded2532883e
parent278d6f901e1380bf1764c129b8418ea3d181e8e3 (diff)
parent1717a8f9e04e6dbfed5921bea1e27ed748ad278f (diff)
downloadotp-01793d6e6b4e194d667cd31cb64e21af562b48f3.tar.gz
otp-01793d6e6b4e194d667cd31cb64e21af562b48f3.tar.bz2
otp-01793d6e6b4e194d667cd31cb64e21af562b48f3.zip
Merge branch 'maint'
-rw-r--r--lib/inets/src/http_server/httpd_request_handler.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl
index 134576059d..8fae9ac46e 100644
--- a/lib/inets/src/http_server/httpd_request_handler.erl
+++ b/lib/inets/src/http_server/httpd_request_handler.erl
@@ -102,8 +102,8 @@ init([Manager, ConfigDB, AcceptTimeout]) ->
KeepAliveTimeOut = 1000 * httpd_util:lookup(ConfigDB, keep_alive_timeout, 150),
case http_transport:negotiate(SocketType, Socket, ?HANDSHAKE_TIMEOUT) of
- {error, _Error} ->
- exit(shutdown); %% Can be 'normal'.
+ {error, Error} ->
+ exit({shutdown, Error}); %% Can be 'normal'.
ok ->
continue_init(Manager, ConfigDB, SocketType, Socket, KeepAliveTimeOut)
end.
@@ -294,7 +294,10 @@ handle_info(Info, #state{mod = ModData} = State) ->
%% cleaning up. When it returns, the gen_server terminates with Reason.
%% The return value is ignored.
%%--------------------------------------------------------------------
-terminate(normal, State) ->
+terminate(Reason, State) when Reason == normal;
+ Reason == shutdown ->
+ do_terminate(State);
+terminate({shutdown,_}, State) ->
do_terminate(State);
terminate(Reason, #state{response_sent = false, mod = ModData} = State) ->
httpd_response:send_status(ModData, 500, none),