summaryrefslogtreecommitdiff
path: root/src/ejabberd_http_bind.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2015-12-07 16:08:57 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2015-12-07 16:09:48 +0100
commit29db302808f94697689d3010b3b589f9a00333b9 (patch)
tree0c82aa6e6f99a6bb8c188ea9995eba38e095f5d5 /src/ejabberd_http_bind.erl
parentFix bug in last commit (diff)
More now() replacements
Diffstat (limited to 'src/ejabberd_http_bind.erl')
-rw-r--r--src/ejabberd_http_bind.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ejabberd_http_bind.erl b/src/ejabberd_http_bind.erl
index a3098779..194b099d 100644
--- a/src/ejabberd_http_bind.erl
+++ b/src/ejabberd_http_bind.erl
@@ -233,7 +233,7 @@ process_request(Data, IP, HOpts) ->
(?NS_HTTP_BIND)/binary, "'/>">>};
XmppDomain ->
NXmppDomain = jid:nameprep(XmppDomain),
- Sid = p1_sha:sha(term_to_binary({now(), make_ref()})),
+ Sid = p1_sha:sha(term_to_binary({p1_time_compat:monotonic_time(), make_ref()})),
case start(NXmppDomain, Sid, <<"">>, IP, HOpts) of
{error, _} ->
{500, ?HEADER,
@@ -448,7 +448,7 @@ handle_sync_event(#http_put{payload_size =
shaper_timer = NewShaperTimer});
%% HTTP GET: send packets to the client
handle_sync_event({http_get, Rid, Wait, Hold}, From, StateName, StateData) ->
- TNow = tnow(),
+ TNow = p1_time_compat:system_time(micro_seconds),
if (Hold > 0) and
((StateData#state.output == []) or (StateData#state.rid < Rid)) and
((TNow - StateData#state.ctime) < (Wait*1000*1000)) and
@@ -606,7 +606,7 @@ process_http_put(#http_put{rid = Rid, attrs = Attrs,
end
end
end,
- TNow = tnow(),
+ TNow = p1_time_compat:system_time(micro_seconds),
LastPoll = if Payload == [] -> TNow;
true -> 0
end,
@@ -1185,11 +1185,6 @@ get_max_pause({Host, _}) ->
?MAX_PAUSE);
get_max_pause(_) -> ?MAX_PAUSE.
-%% Current time as integer
-tnow() ->
- {TMegSec, TSec, TMSec} = now(),
- (TMegSec * 1000000 + TSec) * 1000000 + TMSec.
-
check_default_xmlns(#xmlel{name = Name, attrs = Attrs,
children = Els} =
El) ->