Commit 41f620d9 by Edward Thomson

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.
parent df2cc108
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment