From 8b9efa6590267045419d81af14f219eea4d0de14 Mon Sep 17 00:00:00 2001 From: Michal Ptaszek Date: Thu, 15 Oct 2015 09:22:50 -0500 Subject: [PATCH] Reset proxy_setup settings on connection failure When using proxy and having issues with connecting to the end service make sure that the initial proxy handshake is re-run each time to reconnect. --- src/lhttpc.app.src | 2 +- src/lhttpc_client.erl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lhttpc.app.src b/src/lhttpc.app.src index 4b1cc8a2..7cabe37a 100644 --- a/src/lhttpc.app.src +++ b/src/lhttpc.app.src @@ -29,7 +29,7 @@ %%% @end {application, lhttpc, [{description, "Lightweight HTTP Client"}, - {vsn, "1.3.0"}, + {vsn, "1.3.1"}, {modules, []}, {registered, [lhttpc_manager]}, {applications, [kernel, stdlib, ssl, crypto]}, diff --git a/src/lhttpc_client.erl b/src/lhttpc_client.erl index 0f5542f3..1b20a123 100644 --- a/src/lhttpc_client.erl +++ b/src/lhttpc_client.erl @@ -282,6 +282,7 @@ send_request(State) -> lhttpc_sock:close(Socket, Ssl), NewState = State#client_state{ socket = undefined, + proxy_setup = false, attempts = State#client_state.attempts - 1 }, send_request(NewState); @@ -457,6 +458,7 @@ read_response(State, Vsn, {StatusCode, _} = Status, Hdrs) -> lhttpc_sock:close(Socket, Ssl), NewState = State#client_state{ socket = undefined, + proxy_setup = false, attempts = State#client_state.attempts - 1 }, send_request(NewState);