diff options
author | Ingela Anderton Andin <[email protected]> | 2016-03-02 11:23:56 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2016-03-02 11:23:56 +0100 |
commit | 1717a8f9e04e6dbfed5921bea1e27ed748ad278f (patch) | |
tree | e1dc4cb81d694b58ede49f908e046b87dea28a41 /lib/inets | |
parent | 0d527441af4d2721d4b2d98a100d9e810a90fc22 (diff) | |
parent | c66f556d9c2be6dc5924e384872dca82a653c970 (diff) | |
download | otp-1717a8f9e04e6dbfed5921bea1e27ed748ad278f.tar.gz otp-1717a8f9e04e6dbfed5921bea1e27ed748ad278f.tar.bz2 otp-1717a8f9e04e6dbfed5921bea1e27ed748ad278f.zip |
Merge branch 'ia/inets/httpd-gracefull-error/OTP-13389' into maint
* ia/inets/httpd-gracefull-error/OTP-13389:
inets: No error reports for expected termination
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/src/http_server/httpd_request_handler.erl | 9 |
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), |