From 41f620d9a1fd701efb6b9910c364d1eac4d47355 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sun, 18 Nov 2018 19:10:50 +0000 Subject: http: only load proxy configuration during connection Only load the proxy configuration during connection; we need this data when we're going to connect to the server, however we may mutate it after connection (connecting through a CONNECT proxy means that we should send requests like normal). If we reload the proxy configuration but do not actually reconnect (because we're in a keep-alive session) then we will reload the proxy configuration that we should have mutated. Thus, only load the proxy configuration when we know that we're going to reconnect. --- src/transports/http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/transports/http.c b/src/transports/http.c index ce2e30964..4b552acf7 100644 --- a/src/transports/http.c +++ b/src/transports/http.c @@ -927,6 +927,9 @@ static int http_connect(http_subtransport *t) t->parse_finished) return 0; + if ((error = load_proxy_config(t)) < 0) + return error; + if (t->server.stream) { git_stream_close(t->server.stream); git_stream_free(t->server.stream); @@ -1368,8 +1371,7 @@ static int http_action( assert(t->server.url.host && t->server.url.port && t->server.url.path); - if ((ret = load_proxy_config(t)) < 0 || - (ret = http_connect(t)) < 0) + if ((ret = http_connect(t)) < 0) return ret; switch (action) { -- cgit v1.2.1