aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-09-10 15:49:00 +0200
committerIngela Anderton Andin <[email protected]>2015-09-10 15:49:00 +0200
commitaa0c98308a8e77b9d9b77a845494673cbe1c4e04 (patch)
tree54b79a4d0554d952c23ae4f8f1b12a8ee4ee76f2
parentb40cec909976c7999ab8d1e526da8188df5a41b1 (diff)
parent1ee5aaf02cc2525a2c27b91f5c6c771e4965fd9e (diff)
downloadotp-aa0c98308a8e77b9d9b77a845494673cbe1c4e04.tar.gz
otp-aa0c98308a8e77b9d9b77a845494673cbe1c4e04.tar.bz2
otp-aa0c98308a8e77b9d9b77a845494673cbe1c4e04.zip
Merge branch 'ia/inets/format_status/OTP-12976' into maint
* ia/inets/format_status/OTP-12976: inets: httpd - Add format_status/2 to httpd_request_handler
-rw-r--r--lib/inets/src/http_server/httpd_request_handler.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl
index 25aea56568..e5d006c1fd 100644
--- a/lib/inets/src/http_server/httpd_request_handler.erl
+++ b/lib/inets/src/http_server/httpd_request_handler.erl
@@ -30,7 +30,7 @@
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
- terminate/2, code_change/3]).
+ terminate/2, code_change/3, format_status/2]).
-include("httpd.hrl").
-include("http_internal.hrl").
@@ -310,6 +310,18 @@ do_terminate(#state{mod = ModData} = State) ->
cancel_request_timeout(State),
httpd_socket:close(ModData#mod.socket_type, ModData#mod.socket).
+format_status(normal, [_, State]) ->
+ [{data, [{"StateData", State}]}];
+format_status(terminate, [_, State]) ->
+ Mod = (State#state.mod),
+ case Mod#mod.socket_type of
+ ip_comm ->
+ [{data, [{"StateData", State}]}];
+ {essl, _} ->
+ %% Do not print ssl options in superviosr reports
+ [{data, [{"StateData",
+ State#state{mod = Mod#mod{socket_type = 'TLS'}}}]}]
+ end.
%%--------------------------------------------------------------------
%% code_change(OldVsn, State, Extra) -> {ok, NewState}