diff options
author | Joel Depooter <joel.depooter@safe.com> | 2021-09-23 15:54:24 -0700 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2021-09-24 01:41:53 -0400 |
commit | 739de69ee6d065651bf318a6b90c44a67b76efe1 (patch) | |
tree | 67ab09bf77a71113ed107b34fabcae53ac2e05cc | |
parent | bb72392647404dce931b73adaf81edb4670e34b2 (diff) | |
download | curl-739de69ee6d065651bf318a6b90c44a67b76efe1.tar.gz |
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
-rw-r--r-- | lib/vssh/libssh2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index a772f1f9b..8ccfe68a8 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 |