25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Use websocket pings also on old style connections

This commit is contained in:
Paweł Chmielowski 2015-08-05 16:08:06 +02:00
parent dc0934bff7
commit 3a5dd51b42

View File

@ -263,10 +263,9 @@ setup_timers(StateData) ->
Timer = erlang:start_timer(StateData#state.timeout,
self(), []),
cancel_timer(StateData#state.ping_timer),
PingTimer = case {StateData#state.ping_interval, StateData#state.rfc_compilant} of
{0, _} -> StateData#state.ping_timer;
{_, false} -> StateData#state.ping_timer;
{V, _} -> erlang:start_timer(V, self(), [])
PingTimer = case StateData#state.ping_interval of
0 -> StateData#state.ping_timer;
V -> erlang:start_timer(V, self(), [])
end,
StateData#state{timer = Timer, ping_timer = PingTimer,
pong_expected = false}.