diff --git a/src/lhttpc_client.erl b/src/lhttpc_client.erl index 0f5542f3..1fa6b8f3 100644 --- a/src/lhttpc_client.erl +++ b/src/lhttpc_client.erl @@ -95,8 +95,7 @@ request(From, Host, Port, Ssl, Path, Method, Hdrs, Body, Options) -> {response, self(), {error, Reason}}; error:closed -> {response, self(), {error, connection_closed}}; - error:Reason -> - Stack = erlang:get_stacktrace(), + error:Reason:Stack -> {response, self(), {error, {Reason, Stack}}} end, case Result of @@ -221,9 +220,9 @@ send_request(#client_state{socket = undefined} = State) -> catch exit:{{{badmatch, {error, {asn1, _}}}, _}, _} -> throw(ssl_decode_error); - Type:Error -> + Type:Error:Stack -> error_logger:error_msg("Socket connection error: ~p ~p, ~p", - [Type, Error, erlang:get_stacktrace()]) + [Type, Error, Stack]) end; send_request(#client_state{proxy = #lhttpc_url{}, proxy_setup = false} = State) -> % use a proxy. diff --git a/src/lhttpc_manager.erl b/src/lhttpc_manager.erl index 94c23653..522bc428 100644 --- a/src/lhttpc_manager.erl +++ b/src/lhttpc_manager.erl @@ -263,7 +263,7 @@ init(Options) -> 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) - apply(ssl, seed, [crypto:rand_bytes(255)]); + apply(ssl, seed, [crypto:strong_rand_bytes(255)]); false -> ok end,