25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

fixes timeout calculation

This commit is contained in:
Evgeniy Khramtsov 2010-10-14 20:11:44 +10:00
parent 4a6fc46713
commit 254686ab46

View File

@ -573,8 +573,8 @@ handle_msg(Msg, Parent, Name, StateName, StateData, Mod, _Time,
{ok, Clone} ->
process_flag(trap_exit, true),
MRef = erlang:monitor(process, Clone),
NowDiff = timer:now_diff(now(), Now),
TimeLeft = lists:max([Time1 - NowDiff, 0]) div 1000,
NowDiff = timer:now_diff(now(), Now) div 1000,
TimeLeft = lists:max([Time1 - NowDiff, 0]),
TRef = erlang:start_timer(TimeLeft, self(), timeout),
relay_messages(MRef, TRef, Clone, Queue);
Reply ->
@ -636,8 +636,8 @@ handle_msg(Msg, Parent, Name, StateName, StateData,
{ok, Clone} ->
process_flag(trap_exit, true),
MRef = erlang:monitor(process, Clone),
NowDiff = timer:now_diff(now(), Now),
TimeLeft = lists:max([Time1 - NowDiff, 0]) div 1000,
NowDiff = timer:now_diff(now(), Now) div 1000,
TimeLeft = lists:max([Time1 - NowDiff, 0]),
TRef = erlang:start_timer(TimeLeft, self(), timeout),
relay_messages(MRef, TRef, Clone, Queue);
Reply ->