mirror of
https://github.com/curl/curl.git
synced 2025-01-30 14:22:33 +08:00
SSH: init and cleanup libssh2 in global_init/cleanup
The necessary libssh2 functions require libssh2 1.2.5 or later.
This commit is contained in:
parent
79dc74e84d
commit
107146676e
5
CHANGES
5
CHANGES
@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Daniel Stenberg (26 Apr 2010)
|
||||||
|
- Make use of the libssh2_init/exit functions that libssh2 added in version
|
||||||
|
1.2.5. Using them will improve how libcurl works in threaded situations when
|
||||||
|
SCP and SFTP are transfered.
|
||||||
|
|
||||||
Daniel Stenberg (25 Apr 2010)
|
Daniel Stenberg (25 Apr 2010)
|
||||||
- Based on work by Kamil Dudka, I've introduced the new configure option
|
- Based on work by Kamil Dudka, I've introduced the new configure option
|
||||||
--enable-threaded-resolver. When used, the configure script will check for
|
--enable-threaded-resolver. When used, the configure script will check for
|
||||||
|
11
lib/easy.c
11
lib/easy.c
@ -287,6 +287,13 @@ CURLcode curl_global_init(long flags)
|
|||||||
}
|
}
|
||||||
#endif
|
#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;
|
init_flags = flags;
|
||||||
|
|
||||||
/* Preset pseudo-random number sequence. */
|
/* Preset pseudo-random number sequence. */
|
||||||
@ -355,6 +362,10 @@ void curl_global_cleanup(void)
|
|||||||
amiga_cleanup();
|
amiga_cleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_EXIT)
|
||||||
|
(void)libssh2_exit();
|
||||||
|
#endif
|
||||||
|
|
||||||
init_flags = 0;
|
init_flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user