summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-08-17 11:00:05 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2016-10-01 17:41:28 +0200
commit12b73ff3806d167cf2561c0b21e5354bb6f81601 (patch)
tree87dbe31c4328c0361ba018960e45fad401c88f27
parent0dea429978cf608d77344b18a303087990b903de (diff)
downloadlibgit2-12b73ff3806d167cf2561c0b21e5354bb6f81601.tar.gz
transports: http: reset `connected` flag when re-connecting transport
When calling `http_connect` on a subtransport whose stream is already connected, we first close the stream in case no keep-alive is in use. When doing so, we do not reset the transport's connection state, though. Usually, this will do no harm in case the subsequent connect will succeed. But when the connection fails we are left with a substransport which is tagged as connected but which has no valid stream attached. Fix the issue by resetting the subtransport's connected-state when closing its stream in `http_connect`.
-rw-r--r--src/transports/http.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index 4bf1d91bf..f0efd956a 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -569,6 +569,7 @@ static int http_connect(http_subtransport *t)
git_stream_close(t->io);
git_stream_free(t->io);
t->io = NULL;
+ t->connected = 0;
}
if (t->connection_data.use_ssl) {