Skip to content

Commit 17339cb

Browse files
authored
Merge pull request libgit2#4596 from pks-t/pks/ssh-disconnect
transports: ssh: disconnect session before freeing it
2 parents 1926163 + 874ce16 commit 17339cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/transports/ssh.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static void ssh_stream_free(git_smart_subtransport_stream *stream)
212212
}
213213

214214
if (s->session) {
215+
libssh2_session_disconnect(s->session, "closing transport");
215216
libssh2_session_free(s->session);
216217
s->session = NULL;
217218
}
@@ -489,7 +490,7 @@ static int _git_ssh_session_create(
489490
}
490491

491492
do {
492-
rc = libssh2_session_startup(s, socket->s);
493+
rc = libssh2_session_handshake(s, socket->s);
493494
} while (LIBSSH2_ERROR_EAGAIN == rc || LIBSSH2_ERROR_TIMEOUT == rc);
494495

495496
if (rc != LIBSSH2_ERROR_NONE) {

0 commit comments

Comments
 (0)