Fix logic in "on-the-fly" crypto init.
Этот коммит содержится в:
родитель
aebcc45a37
Коммит
6d253324be
10
src/global.c
10
src/global.c
@ -41,7 +41,8 @@
|
|||||||
static int _libssh2_initialized = 0;
|
static int _libssh2_initialized = 0;
|
||||||
static int _libssh2_init_flags = 0;
|
static int _libssh2_init_flags = 0;
|
||||||
|
|
||||||
LIBSSH2_API int libssh2_init(int flags)
|
LIBSSH2_API int
|
||||||
|
libssh2_init(int flags)
|
||||||
{
|
{
|
||||||
if (_libssh2_initialized == 0 && !(flags & LIBSSH2_INIT_NO_CRYPTO)) {
|
if (_libssh2_initialized == 0 && !(flags & LIBSSH2_INIT_NO_CRYPTO)) {
|
||||||
libssh2_crypto_init();
|
libssh2_crypto_init();
|
||||||
@ -53,7 +54,8 @@ LIBSSH2_API int libssh2_init(int flags)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSSH2_API void libssh2_exit()
|
LIBSSH2_API void
|
||||||
|
libssh2_exit(void)
|
||||||
{
|
{
|
||||||
if (_libssh2_initialized == 0)
|
if (_libssh2_initialized == 0)
|
||||||
return;
|
return;
|
||||||
@ -68,8 +70,8 @@ LIBSSH2_API void libssh2_exit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_libssh2_init_if_needed (void)
|
_libssh2_init_if_needed(void)
|
||||||
{
|
{
|
||||||
if (_libssh2_initialized)
|
if (_libssh2_initialized == 0)
|
||||||
libssh2_init (0);
|
libssh2_init (0);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user