summaryrefslogtreecommitdiff
path: root/lib/version.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-16 15:32:05 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-17 16:57:58 +0200
commitea28a6cb2f168ce0b4e01c0f05e3675687dbd497 (patch)
tree064695cfa7d49323e3a73d53f127f37c11f0b7dd /lib/version.c
parent1a7634e484f1f1b46cada618ac3df04a9273571f (diff)
downloadcurl-ea28a6cb2f168ce0b4e01c0f05e3675687dbd497.tar.gz
ssh: add a generic Curl_ssh_version function for SSH backends
Closes #4235
Diffstat (limited to 'lib/version.c')
-rw-r--r--lib/version.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/lib/version.c b/lib/version.c
index afad726d8..ae2b09d31 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -54,18 +54,6 @@
#include <librtmp/rtmp.h>
#endif
-#ifdef USE_LIBSSH2
-#include <libssh2.h>
-#endif
-
-#ifdef HAVE_LIBSSH2_VERSION
-/* get it run-time if possible */
-#define CURL_LIBSSH2_VERSION libssh2_version(0)
-#else
-/* use build-time if run-time not possible */
-#define CURL_LIBSSH2_VERSION LIBSSH2_VERSION
-#endif
-
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#ifdef __SYMBIAN32__
@@ -173,13 +161,12 @@ char *curl_version(void)
left -= len;
ptr += len;
#endif
-#ifdef USE_LIBSSH2
- len = msnprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION);
- left -= len;
- ptr += len;
-#endif
-#ifdef USE_LIBSSH
- len = msnprintf(ptr, left, " libssh/%s", CURL_LIBSSH_VERSION);
+#ifdef USE_SSH
+ if(left) {
+ *ptr++=' ';
+ left--;
+ }
+ len = Curl_ssh_version(ptr, left);
left -= len;
ptr += len;
#endif
@@ -458,11 +445,8 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
#endif /* _LIBICONV_VERSION */
#endif
-#if defined(USE_LIBSSH2)
- msnprintf(ssh_buffer, sizeof(ssh_buffer), "libssh2/%s", LIBSSH2_VERSION);
- version_info.libssh_version = ssh_buffer;
-#elif defined(USE_LIBSSH)
- msnprintf(ssh_buffer, sizeof(ssh_buffer), "libssh/%s", CURL_LIBSSH_VERSION);
+#if defined(USE_SSH)
+ Curl_ssh_version(ssh_buffer, sizeof(ssh_buffer));
version_info.libssh_version = ssh_buffer;
#endif