diff --git a/.gitignore b/.gitignore index 8ea4920..e9a6c5d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ cmullaparthi-ibrowse-07153bc.tar.gz /ibrowse-4.2.4.tar.gz /ibrowse-4.3.tar.gz /ibrowse-4.4.tar.gz +/ibrowse-4.4.1.tar.gz diff --git a/erlang-ibrowse-0001-add-erlang-19-20-for-test.patch b/erlang-ibrowse-0001-add-erlang-19-20-for-test.patch deleted file mode 100644 index 71f34eb..0000000 --- a/erlang-ibrowse-0001-add-erlang-19-20-for-test.patch +++ /dev/null @@ -1,165 +0,0 @@ -From: getong -Date: Fri, 1 Sep 2017 17:15:04 +0800 -Subject: [PATCH] add erlang 19, 20 for test - - -diff --git a/.travis.yml b/.travis.yml -index 2dd9ad6..3993bf2 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -7,6 +7,8 @@ otp_release: - - 18.0 - - 18.1 - - 18.2.1 -+ - 19.3 -+ - 20.0 - before_script: - - "./bootstrap_travis.sh" - script: "./rebar3 eunit" -diff --git a/rebar.config b/rebar.config -index 4485a22..eaa892c 100644 ---- a/rebar.config -+++ b/rebar.config -@@ -1,3 +1,11 @@ --{erl_opts, [debug_info, warnings_as_errors, warn_unused_vars, nowarn_shadow_vars, warn_unused_import]}. -+{erl_opts, [ -+ debug_info, -+ warnings_as_errors, -+ warn_unused_vars, -+ nowarn_shadow_vars, -+ warn_unused_import, -+ {platform_define, "18|19|^2", new_rand}, -+ {platform_define, "^2", ets_ref} -+ ]}. - {xref_checks, [undefined_function_calls, deprecated_function_calls]}. - {eunit_opts, [verbose]}. -diff --git a/src/ibrowse.erl b/src/ibrowse.erl -index 648c698..2066799 100644 ---- a/src/ibrowse.erl -+++ b/src/ibrowse.erl -@@ -679,6 +679,21 @@ all_trace_off() -> - %% @doc Shows some internal information about load balancing. Info - %% about workers spawned using spawn_worker_process/2 or - %% spawn_link_worker_process/2 is not included. -+-ifdef(ets_ref). -+show_dest_status() -> -+ io:format("~-40.40s | ~-5.5s | ~-10.10s | ~s~n", -+ ["Server:port", "ETS", "Num conns", "LB Pid"]), -+ io:format("~80.80.=s~n", [""]), -+ Metrics = get_metrics(), -+ lists:foreach( -+ fun({Host, Port, {Lb_pid, _, Tid, Size, _}}) -> -+ io:format("~40.40s | ~-5.5s | ~-5.5s | ~p~n", -+ [Host ++ ":" ++ integer_to_list(Port), -+ ref_to_list(Tid), -+ integer_to_list(Size), -+ Lb_pid]) -+ end, Metrics). -+-else. - show_dest_status() -> - io:format("~-40.40s | ~-5.5s | ~-10.10s | ~s~n", - ["Server:port", "ETS", "Num conns", "LB Pid"]), -@@ -692,6 +707,7 @@ show_dest_status() -> - integer_to_list(Size), - Lb_pid]) - end, Metrics). -+-endif. - - show_dest_status(Url) -> - #url{host = Host, port = Port} = ibrowse_lib:parse_url(Url), -diff --git a/test/ibrowse_load_test.erl b/test/ibrowse_load_test.erl -index eef0aaf..076c46b 100644 ---- a/test/ibrowse_load_test.erl -+++ b/test/ibrowse_load_test.erl -@@ -1,5 +1,33 @@ - -module(ibrowse_load_test). ---compile(export_all). -+%%-compile(export_all). -+-export([ -+ random_seed/0, -+ start/3, -+ query_state/0, -+ shutdown/0, -+ start_1/3, -+ calculate_timings/0, -+ get_mmv/2, -+ spawn_workers/2, -+ spawn_workers/4, -+ wait_for_workers/1, -+ worker_loop/2, -+ update_unknown_counter/2 -+ ]). -+ -+-ifdef(new_rand). -+ -+-define(RAND, rand). -+random_seed() -> -+ ok. -+ -+-else. -+ -+-define(RAND, random). -+random_seed() -> -+ random:seed(os:timestamp()). -+ -+-endif. - - -define(ibrowse_load_test_counters, ibrowse_load_test_counters). - -@@ -95,7 +123,7 @@ spawn_workers(0, _Num_requests, _Parent, Acc) -> - lists:reverse(Acc); - spawn_workers(Num_workers, Num_requests, Parent, Acc) -> - Pid_ref = spawn_monitor(fun() -> -- random:seed(os:timestamp()), -+ random_seed(), - case catch worker_loop(Parent, Num_requests) of - {'EXIT', Rsn} -> - io:format("Worker crashed with reason: ~p~n", [Rsn]); -@@ -135,7 +163,7 @@ wait_for_workers([{Pid, Pid_ref} | T] = Pids) -> - worker_loop(Parent, 0) -> - Parent ! {done, self()}; - worker_loop(Parent, N) -> -- Delay = random:uniform(100), -+ Delay = ?RAND:uniform(100), - Url = case Delay rem 10 of - %% Change 10 to some number between 0-9 depending on how - %% much chaos you want to introduce into the server -diff --git a/test/ibrowse_test_server.erl b/test/ibrowse_test_server.erl -index f30e895..3ba7c67 100644 ---- a/test/ibrowse_test_server.erl -+++ b/test/ibrowse_test_server.erl -@@ -11,6 +11,12 @@ - get_conn_pipeline_depth/0 - ]). - -+-ifdef(new_rand). -+-define(RAND, rand). -+-else. -+-define(RAND, random). -+-endif. -+ - -record(request, {method, uri, version, headers = [], body = [], state}). - - -define(dec2hex(X), erlang:integer_to_list(X, 16)). -@@ -290,7 +296,7 @@ process_request(Sock, Sock_type, Req) -> - do_trace("Recvd req: ~p~n", [Req]), - Resp = <<"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n">>, - do_send(Sock, Sock_type, Resp), -- timer:sleep(random:uniform(100)). -+ timer:sleep(?RAND:uniform(100)). - - do_send(Sock, tcp, Resp) -> - gen_tcp:send(Sock, Resp); -diff --git a/test/ibrowse_tests.erl b/test/ibrowse_tests.erl -index d3b07b1..594b8ed 100644 ---- a/test/ibrowse_tests.erl -+++ b/test/ibrowse_tests.erl -@@ -17,7 +17,7 @@ - -define(LONG_TIMEOUT_MS, 30000). - -define(PAUSE_FOR_CONNECTIONS_MS, 2000). - ---compile(export_all). -+%%-compile(export_all). - - setup() -> - application:start(crypto), diff --git a/erlang-ibrowse.spec b/erlang-ibrowse.spec index ae98d2d..c79043b 100644 --- a/erlang-ibrowse.spec +++ b/erlang-ibrowse.spec @@ -1,20 +1,16 @@ %global realname ibrowse %global upstream cmullaparthi -# Technically, we're noarch; but erlang whose directories we install into is not. -%global debug_package %{nil} Name: erlang-%{realname} -Version: 4.4 -Release: 7%{?dist} +Version: 4.4.1 +Release: 1%{?dist} +BuildArch: noarch Summary: Erlang HTTP client License: BSD or LGPLv2+ URL: https://github.com/%{upstream}/%{realname} -%if 0%{?el7}%{?fedora} VCS: scm:git:https://github.com/%{upstream}/%{realname}.git -%endif Source0: https://github.com/%{upstream}/%{realname}/archive/v%{version}/%{realname}-%{version}.tar.gz -Patch1: erlang-ibrowse-0001-add-erlang-19-20-for-test.patch BuildRequires: erlang-rebar @@ -46,6 +42,10 @@ install -D -p -m 0644 priv/%{realname}.conf %{buildroot}%{erlang_appdir}/priv/%{ %changelog +* Fri Feb 22 2019 Peter Lemenkov - 4.4.1-1 +- Ver. 4.4.1 +- Switch to noarch + * Thu Jan 31 2019 Fedora Release Engineering - 4.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 5c3a873..f753540 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ibrowse-4.4.tar.gz) = 2013ea0ccf7789a943208b48071342937c5956d6f5e97d23103b466b27f8f578fec5f2347cece4fb56755285b74106d4b5e9587089de01a50d4a54afa7000aa2 +SHA512 (ibrowse-4.4.1.tar.gz) = 17326bab8f64fe996d72985dbc45b51fdd163cd5505a191d76d38ca073cb4e0c60efc329eb72917a6b17534962ca62bbb600c53b5fd5de8a7602984717867aec