Subject: Re: patch to add libssh2_init() and libssh2_exit()

Re: patch to add libssh2_init() and libssh2_exit()

From: Simon Josefsson <>
Date: Wed, 10 Mar 2010 12:42:55 +0100

Lars Nordin <> writes:

> Please find attached patch to make libssh2 have a clean way of
> initialize the library.

Hi. Great, I agree libssh2 should have proper global init/exit

> The patch adds a new file, global.c. The is changes, but
> not the WIN32 files.

The file is automatically generated, the file to modify is

You forgot to attach the new globals.c?

> + * LIBSSH2_INIT_ALL: Initialize everything

Maybe we could remove this one? I think it will restrict us too much in
the future, we could conceivable have init-flags that are not related to
disable some initialization, and then this flag becomes confusing. Just
document that callers should pass 0 if they don't want to use any flag.

> + ERR_load_crypto_strings();
> + OpenSSL_add_all_algorithms();
> + ENGINE_load_builtin_engines();

Are the first and last calls really needed?

Received on 2010-03-10