Parcourir la source

Add strictly monotonic timestamp (#173)

pull/166/head
Noah Shaw il y a 4 ans
committed by GitHub
Parent
révision
6c81151591
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 4AEE18F83AFDEB23
1 fichiers modifiés avec 10 ajouts et 6 suppressions
  1. +10
    -6
      src/ibrowse_http_client.erl

+ 10
- 6
src/ibrowse_http_client.erl Voir le fichier

@ -484,6 +484,15 @@ accumulate_response(Data, #state{reply_buffer = RepBuf,
State#state{reply_buffer = RepBuf_1}
end.
generate_timestamp() ->
case catch erlang:unique_integer([positive]) of
{'EXIT', _} ->
erlang:apply(erlang, now, []);
Unique ->
{A,B,C} = os:timestamp(),
{A * 1000000 + B, C, Unique}
end.
make_tmp_filename(true) ->
DownloadDir = ibrowse:get_config_value(download_dir, filename:absname("./")),
{A,B,C} = os:timestamp(),
@ -2050,12 +2059,7 @@ cancel_timer(Ref, {eat_message, Msg}) ->
end.
make_req_id() ->
case catch erlang:unique_integer() of
{'EXIT', _} ->
erlang:apply(erlang, now, []);
V ->
V
end.
generate_timestamp().
to_lower(Str) when is_binary(Str) ->
to_lower(binary_to_list(Str));

Chargement…
Annuler
Enregistrer