25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Use os time instead of system time in values returned by mod_time

This timer should correctly work with time warps, and should fix
issue #3390
This commit is contained in:
Paweł Chmielowski 2020-09-15 12:11:00 +02:00
parent 9629601d0b
commit b89f3c442c

View File

@ -55,7 +55,7 @@ process_local_iq(#iq{type = set, lang = Lang} = IQ) ->
Txt = ?T("Value 'set' of 'type' attribute is not allowed"), Txt = ?T("Value 'set' of 'type' attribute is not allowed"),
xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang)); xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
process_local_iq(#iq{type = get} = IQ) -> process_local_iq(#iq{type = get} = IQ) ->
Now = erlang:timestamp(), Now = os:timestamp(),
Now_universal = calendar:now_to_universal_time(Now), Now_universal = calendar:now_to_universal_time(Now),
Now_local = calendar:universal_time_to_local_time(Now_universal), Now_local = calendar:universal_time_to_local_time(Now_universal),
Seconds_diff = Seconds_diff =