Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbf6545

Browse files
committed
transports: http: set substream as disconnected after closing
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`.
1 parent 26a8617 commit dbf6545

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/transports/http.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ static int http_connect(http_subtransport *t)
599599
git_stream_close(t->io);
600600
git_stream_free(t->io);
601601
t->io = NULL;
602+
t->connected = 0;
602603
}
603604

604605
if (t->connection_data.use_ssl) {

0 commit comments

Comments
 (0)