From 3792970003904944aa83d238a7227202f1b21f26 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Mon, 24 Oct 2011 15:25:10 +0200 Subject: [PATCH 1/3] randomize ssl in lhttpc_manager:init/1 instead of in lhttpc:start/2 --- src/lhttpc.erl | 8 -------- src/lhttpc_manager.erl | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lhttpc.erl b/src/lhttpc.erl index 974e2714..d4aa26f1 100644 --- a/src/lhttpc.erl +++ b/src/lhttpc.erl @@ -52,14 +52,6 @@ -spec start(normal | {takeover, node()} | {failover, node()}, any()) -> {ok, pid()}. start(_, _) -> - case lists:member({seed,1}, ssl:module_info(exports)) of - true -> - % Make sure that the ssl random number generator is seeded - % This was new in R13 (ssl-3.10.1 in R13B vs. ssl-3.10.0 in R12B-5) - ssl:seed(crypto:rand_bytes(255)); - false -> - ok - end, lhttpc_sup:start_link(). %% @hidden diff --git a/src/lhttpc_manager.erl b/src/lhttpc_manager.erl index 4ac4ec2b..30adf1c6 100644 --- a/src/lhttpc_manager.erl +++ b/src/lhttpc_manager.erl @@ -102,6 +102,14 @@ start_link() -> -spec init(any()) -> {ok, #httpc_man{}}. init(_) -> process_flag(priority, high), + case lists:member({seed,1}, ssl:module_info(exports)) of + true -> + % Make sure that the ssl random number generator is seeded + % This was new in R13 (ssl-3.10.1 in R13B vs. ssl-3.10.0 in R12B-5) + ssl:seed(crypto:rand_bytes(255)); + false -> + ok + end, {ok, Timeout} = application:get_env(lhttpc, connection_timeout), {ok, #httpc_man{timeout = Timeout}}. From cd06f97bcc93d45a4cf7e9cbe45b7294435a8baa Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Mon, 24 Oct 2011 15:25:20 +0200 Subject: [PATCH 2/3] register lhttpc_sup locally --- src/lhttpc_sup.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lhttpc_sup.erl b/src/lhttpc_sup.erl index e96a717e..6135cdef 100644 --- a/src/lhttpc_sup.erl +++ b/src/lhttpc_sup.erl @@ -46,7 +46,7 @@ %% @end -spec start_link() -> {ok, pid()} | {error, atom()}. start_link() -> - supervisor:start_link(?MODULE, nil). + supervisor:start_link({local, ?MODULE}, ?MODULE, []). %% @hidden -spec init(any()) -> {ok, {{atom(), integer(), integer()}, [child()]}}. From 02d1c1d4d7940a0be032dd2d8ccea4bc29ccec22 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Tue, 20 Sep 2011 14:30:58 +0200 Subject: [PATCH 3/3] Add debug info to binaries --- rebar.config | 1 + 1 file changed, 1 insertion(+) diff --git a/rebar.config b/rebar.config index 4483aa93..3e8f59b4 100644 --- a/rebar.config +++ b/rebar.config @@ -1 +1,2 @@ +{erl_opts, [debug_info]}. {cover_enabled, true}.