aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2017-07-13 10:49:35 +0200
committerChristophe Romain <christophe.romain@process-one.net>2017-07-27 17:53:16 +0200
commit0cfec92c148125f3ef700a242a6ee905894637dc (patch)
tree8a3a8216056d6b64030c07a16becc8555e9f94e7
parentFix get_module_opt call in mod_block_strangers (diff)
Generate log messages when websocket is closed due timeouts
-rw-r--r--src/ejabberd_http_ws.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ejabberd_http_ws.erl b/src/ejabberd_http_ws.erl
index f4a73cc39..2c44d6552 100644
--- a/src/ejabberd_http_ws.erl
+++ b/src/ejabberd_http_ws.erl
@@ -241,6 +241,7 @@ handle_info(PingPong, StateName, StateData) when PingPong == ping orelse
StateData2#state{pong_expected = false}};
handle_info({timeout, Timer, _}, _StateName,
#state{timer = Timer} = StateData) ->
+ ?DEBUG("Closing websocket connection from hitting inactivity timeout", []),
{stop, normal, StateData};
handle_info({timeout, Timer, _}, StateName,
#state{ping_timer = Timer, ws = {_, WsPid}} = StateData) ->
@@ -253,6 +254,7 @@ handle_info({timeout, Timer, _}, StateName,
{next_state, StateName,
StateData#state{ping_timer = PingTimer, pong_expected = true}};
true ->
+ ?DEBUG("Closing websocket connection from missing pongs", []),
{stop, normal, StateData}
end;
handle_info(_, StateName, StateData) ->