mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
ssh_init()
fixes in client.c and server.c for this git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@778 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -31,12 +31,29 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief initialize global cryptographic data structures.
|
||||
*
|
||||
* This function should only be called once, at the begining of the program, in the main thread. It may be omitted if your program is not multithreaded.
|
||||
*
|
||||
* @returns 0
|
||||
*/
|
||||
int ssh_init(void) {
|
||||
if(ssh_crypto_init())
|
||||
return -1;
|
||||
if(ssh_socket_init())
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Finalize and cleanup all libssh and cryptographic data structures.
|
||||
*
|
||||
* This function should only be called once, at the end of the program!
|
||||
*
|
||||
* @returns 0
|
||||
* @returns -1 in case of error
|
||||
@returns 0 otherwise
|
||||
*/
|
||||
int ssh_finalize(void) {
|
||||
ssh_crypto_finalize();
|
||||
|
||||
Reference in New Issue
Block a user