Commit b89988c7f6b422ba58cf4be24edf5bf6eff68ec2

Patrick Steinhardt 2018-03-27T15:03:15

transports: ssh: replace deprecated function `libssh2_session_startup` The function `libssh2_session_startup` has been deprecated since libssh2 version 1.2.8 in favor of `libssh2_session_handshake` introduced in the same version. libssh2 1.2.8 was released in April 2011, so it is already seven years old. It is available in Debian Wheezy, Ubuntu Trusty and CentOS 7.4, so the most important and conservative distros already have it available. As such, it seems safe to just use the new function.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index d92cd1f..23c6433 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -490,7 +490,7 @@ static int _git_ssh_session_create(
 	}
 
 	do {
-		rc = libssh2_session_startup(s, socket->s);
+		rc = libssh2_session_handshake(s, socket->s);
 	} while (LIBSSH2_ERROR_EAGAIN == rc || LIBSSH2_ERROR_TIMEOUT == rc);
 
 	if (rc != LIBSSH2_ERROR_NONE) {