aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-02-29 16:04:20 +0100
committerIngela Anderton Andin <[email protected]>2016-03-01 10:43:11 +0100
commitc66f556d9c2be6dc5924e384872dca82a653c970 (patch)
tree0628b085d49ac13c8c2d06a663a8f5734b54f0b3 /lib
parent6945d1266486d546aa1a591799591fa1e28e1b1d (diff)
downloadotp-c66f556d9c2be6dc5924e384872dca82a653c970.tar.gz
otp-c66f556d9c2be6dc5924e384872dca82a653c970.tar.bz2
otp-c66f556d9c2be6dc5924e384872dca82a653c970.zip
inets: No error reports for expected termination
Diffstat (limited to 'lib')
-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),