couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [16/50] ibrowse commit: updated refs/heads/upstream to b28542d
Date Mon, 22 Aug 2016 11:19:42 GMT
Build under R18 #129


Project: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/commit/62816035
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/tree/62816035
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/diff/62816035

Branch: refs/heads/upstream
Commit: 62816035bb8fba5bd6ce86c64c64820c43ec096f
Parents: 04566c7
Author: Yury Gargay <yury.gargay@gmail.com>
Authored: Thu Jun 25 16:35:10 2015 +0600
Committer: Yury Gargay <yury.gargay@gmail.com>
Committed: Thu Jun 25 16:46:25 2015 +0600

----------------------------------------------------------------------
 src/ibrowse_http_client.erl | 9 +++++++--
 src/ibrowse_lib.erl         | 2 +-
 test/ibrowse_test.erl       | 8 ++++----
 3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/blob/62816035/src/ibrowse_http_client.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl
index ad24351..b9e6c97 100644
--- a/src/ibrowse_http_client.erl
+++ b/src/ibrowse_http_client.erl
@@ -433,7 +433,7 @@ accumulate_response(Data, #state{reply_buffer      = RepBuf,
 
 make_tmp_filename(true) ->
     DownloadDir = ibrowse:get_config_value(download_dir, filename:absname("./")),
-    {A,B,C} = now(),
+    {A,B,C} = os:timestamp(),
     filename:join([DownloadDir,
                    "ibrowse_tmp_file_"++
                    integer_to_list(A) ++
@@ -1923,7 +1923,12 @@ cancel_timer(Ref, {eat_message, Msg}) ->
     end.
 
 make_req_id() ->
-    now().
+    case catch erlang:unqiue_integer() of
+        {'EXIT', _} ->
+            erlang:apply(erlang, now, []);
+        V ->
+            V
+    end.
 
 to_lower(Str) when is_binary(Str) ->
     to_lower(binary_to_list(Str));

http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/blob/62816035/src/ibrowse_lib.erl
----------------------------------------------------------------------
diff --git a/src/ibrowse_lib.erl b/src/ibrowse_lib.erl
index 3362b39..20c74e8 100644
--- a/src/ibrowse_lib.erl
+++ b/src/ibrowse_lib.erl
@@ -369,7 +369,7 @@ default_port(ftp)   -> 21.
 
 printable_date() ->
     {{Y,Mo,D},{H, M, S}} = calendar:local_time(),
-    {_,_,MicroSecs} = now(),
+    {_,_,MicroSecs} = os:timestamp(),
     [integer_to_list(Y),
      $-,
      integer_to_list(Mo),

http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/blob/62816035/test/ibrowse_test.erl
----------------------------------------------------------------------
diff --git a/test/ibrowse_test.erl b/test/ibrowse_test.erl
index 407ffcb..0819668 100644
--- a/test/ibrowse_test.erl
+++ b/test/ibrowse_test.erl
@@ -86,7 +86,7 @@ load_test(Url, NumWorkers, NumReqsPerWorker) when is_list(Url),
     proc_lib:spawn(?MODULE, send_reqs_1, [Url, NumWorkers, NumReqsPerWorker]).
 
 send_reqs_1(Url, NumWorkers, NumReqsPerWorker) ->
-    Start_time = now(),
+    Start_time = os:timestamp(),
     ets:new(pid_table, [named_table, public]),
     ets:new(ibrowse_test_results, [named_table, public]),
     ets:new(ibrowse_errors, [named_table, public, ordered_set]),
@@ -96,7 +96,7 @@ send_reqs_1(Url, NumWorkers, NumReqsPerWorker) ->
     spawn_workers(Url, NumWorkers, NumReqsPerWorker),
     log_msg("Finished spawning workers...~n", []),
     do_wait(Url),
-    End_time = now(),
+    End_time = os:timestamp(),
     log_msg("All workers are done...~n", []),
     log_msg("ibrowse_test_results table: ~n~p~n", [ets:tab2list(ibrowse_test_results)]),
     log_msg("Start time: ~1000.p~n", [calendar:now_to_local_time(Start_time)]),
@@ -174,7 +174,7 @@ do_send_req_1(Url, NumReqs) ->
 	{error, retry_later} ->
 	    ets:update_counter(ibrowse_test_results, retry_later, 1);
 	Err ->
-	    ets:insert(ibrowse_errors, {now(), Err}),
+	    ets:insert(ibrowse_errors, {os:timestamp(), Err}),
 	    ets:update_counter(ibrowse_test_results, other_error, 1),
 	    ok
     end,
@@ -185,7 +185,7 @@ dump_errors() ->
 	0 ->
 	    ok;
 	_ ->
-	    {A, B, C} = now(),
+	    {A, B, C} = os:timestamp(),
 	    Filename = lists:flatten(
 			 io_lib:format("ibrowse_errors_~p_~p_~p.txt" , [A, B, C])),
 	    case file:open(Filename, [write, delayed_write, raw]) of


Mime
View raw message