Subject: [libssh2] Freeing resources

[libssh2] Freeing resources

From: <tonyspoken_at_libero.it>
Date: Mon, 17 Sep 2007 09:31:26 +0200

Hi there.

Some questions and annotations for your library.

1) If i'm going to use non blocking socket architecture, all the "disconnect&free" functions (as well as the "connect" ones) needs to be checked against the EAGAIN value, do they?
I'm talking about calls to: libssh2_sftp_close,libssh2_sftp_shutdown,libssh2_session_disconnect, libssh2_session_free.
2) What happens if one of the "disconnect&free" functions fails for some reasons? Could i call the subsequent needed functions to free the resources? For example if libssh2_session_disconnect fails could i safely call libssh2_session_free to free all the possible resources from memory? If not there's some way to smartly free memory resources?
And what happens if i fail during a libssh2_session_startup... How could i free the resources allocated during libssh2_session_init? (keeping in mind that i'm also using nonblocking sockets). It seems there's a sort of asimmetry between the init function and the free. While the first only creates the structures, the second one frees the memory structures but also performs network activities.

Thanks in advance,
Antonio

------------------------------------------------------
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-09-17