diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-19 20:53:25 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-19 20:57:15 +0100 |
commit | 1ca61bdcb9f344f2005eade0e043789774367d29 (patch) | |
tree | 8696cfe7e96f08e696f1d2396b2fcbfc7e685bba /src | |
parent | 4d86caec599ab760b523a026040bc4f40f8338c9 (diff) | |
download | libgit2-1ca61bdcb9f344f2005eade0e043789774367d29.tar.gz |
fetch: clear the connection data on closecmn/fetch-twice
When we fetch twice with the same remote object, we did not properly
clear the connection flags, so we would leak state from the last
connection.
This can cause the second fetch with the same remote object to fail if
using a HTTP URL where the server redirects to HTTPS, as the second
fetch would see `use_ssl` set and think the initial connection wanted to
downgrade the connection.
Diffstat (limited to 'src')
-rw-r--r-- | src/transports/http.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/transports/http.c b/src/transports/http.c index 4070b683a..234ee229f 100644 --- a/src/transports/http.c +++ b/src/transports/http.c @@ -1009,6 +1009,7 @@ static int http_close(git_smart_subtransport *subtransport) git_vector_clear(&t->auth_contexts); gitno_connection_data_free_ptrs(&t->connection_data); + memset(&t->connection_data, 0x0, sizeof(gitno_connection_data)); return 0; } |