Skip to content

Commit 41f620d

Browse files
committed
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.
1 parent df2cc10 commit 41f620d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/transports/http.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,9 @@ static int http_connect(http_subtransport *t)
927927
t->parse_finished)
928928
return 0;
929929

930+
if ((error = load_proxy_config(t)) < 0)
931+
return error;
932+
930933
if (t->server.stream) {
931934
git_stream_close(t->server.stream);
932935
git_stream_free(t->server.stream);
@@ -1368,8 +1371,7 @@ static int http_action(
13681371

13691372
assert(t->server.url.host && t->server.url.port && t->server.url.path);
13701373

1371-
if ((ret = load_proxy_config(t)) < 0 ||
1372-
(ret = http_connect(t)) < 0)
1374+
if ((ret = http_connect(t)) < 0)
13731375
return ret;
13741376

13751377
switch (action) {

0 commit comments

Comments
 (0)