summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-11-18 19:10:50 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-11-28 15:46:58 +0000
commit41f620d9a1fd701efb6b9910c364d1eac4d47355 (patch)
treee7425f0c6e6e426d938c6b4bcd014da59c48bfc8
parentdf2cc1087f6de8718319e5bcc65ca8e0e07b717e (diff)
downloadlibgit2-41f620d9a1fd701efb6b9910c364d1eac4d47355.tar.gz
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.
-rw-r--r--src/transports/http.c6
1 files changed, 4 insertions, 2 deletions
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) {