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

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

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

Lars Nordin <Lars.Nordin_at_SDlabs.se> 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
functions.

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

The Makefile.in file is automatically generated, the file to modify is
Makefile.inc.

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?

/Simon
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-10