From: Joel Depooter Date: Thu, 23 Sep 2021 22:54:24 +0000 (-0700) Subject: libssh2: Get the version at runtime if possible X-Git-Tag: curl-7_80_0~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=739de69ee6d065651bf318a6b90c44a67b76efe1;p=thirdparty%2Fcurl.git libssh2: Get the version at runtime if possible Previously this code used a compile time constant, meaning that libcurl always reported the libssh2 version that libcurl was built with. This could differ from the libssh2 version actually being used. The new code uses the CURL_LIBSSH2_VERSION macro, which is defined in ssh.h. The macro calls the libssh2_version function if it is available, otherwise it falls back to the compile time version. Closes https://github.com/curl/curl/pull/7768 --- diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index a772f1f9b7..8ccfe68a87 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3610,7 +3610,7 @@ void Curl_ssh_cleanup(void) void Curl_ssh_version(char *buffer, size_t buflen) { - (void)msnprintf(buffer, buflen, "libssh2/%s", LIBSSH2_VERSION); + (void)msnprintf(buffer, buflen, "libssh2/%s", CURL_LIBSSH2_VERSION); } /* The SSH session is associated with the *CONNECTION* but the callback user