summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-04-26 00:36:25 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-04-26 00:36:25 +0200
commit107146676e20a00074321b433baaaeb027464871 (patch)
tree831ec9244ec613ddc7978e599aad43dd64a202a3 /lib
parent79dc74e84de3e239f2c7e2e03317ad2bcf679ab7 (diff)
downloadcurl-107146676e20a00074321b433baaaeb027464871.tar.gz
SSH: init and cleanup libssh2 in global_init/cleanup
The necessary libssh2 functions require libssh2 1.2.5 or later.
Diffstat (limited to 'lib')
-rw-r--r--lib/easy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 35fb018b6..53f417fc3 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -287,6 +287,13 @@ CURLcode curl_global_init(long flags)
}
#endif
+#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT)
+ if(libssh2_init(0)) {
+ DEBUGF(fprintf(stderr, "Error: libssh2_init failed\n"));
+ return CURLE_FAILED_INIT;
+ }
+#endif
+
init_flags = flags;
/* Preset pseudo-random number sequence. */
@@ -355,6 +362,10 @@ void curl_global_cleanup(void)
amiga_cleanup();
#endif
+#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_EXIT)
+ (void)libssh2_exit();
+#endif
+
init_flags = 0;
}