26
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-28 17:38:54 +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, Timer = erlang:start_timer(StateData#state.timeout,
self(), []), self(), []),
cancel_timer(StateData#state.ping_timer), cancel_timer(StateData#state.ping_timer),
PingTimer = case {StateData#state.ping_interval, StateData#state.rfc_compilant} of PingTimer = case StateData#state.ping_interval of
{0, _} -> StateData#state.ping_timer; 0 -> StateData#state.ping_timer;
{_, false} -> StateData#state.ping_timer; V -> erlang:start_timer(V, self(), [])
{V, _} -> erlang:start_timer(V, self(), [])
end, end,
StateData#state{timer = Timer, ping_timer = PingTimer, StateData#state{timer = Timer, ping_timer = PingTimer,
pong_expected = false}. pong_expected = false}.