]> granicus.if.org Git - ejabberd/commitdiff
Generate log messages when websocket is closed due timeouts
authorPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 13 Jul 2017 08:49:35 +0000 (10:49 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 27 Jul 2017 15:53:16 +0000 (17:53 +0200)
src/ejabberd_http_ws.erl

index f4a73cc39974cecf52202b2f39247ce67a678ca6..2c44d65523539a9124fe63a9518662fc2494b396 100644 (file)
@@ -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) ->