1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

Added initialisation logs for threading

This commit is contained in:
Aris Adamantiadis
2010-09-12 21:53:42 +02:00
parent b7af2b2959
commit 5eb7c7b6ec
3 changed files with 12 additions and 5 deletions

View File

@@ -26,6 +26,7 @@
#include <libssh/callbacks.h>
LIBSSH_API int ssh_threads_init(void);
LIBSSH_API void ssh_threads_finalize(void);
void ssh_threads_finalize(void);
const char *ssh_threads_get_type(void);
#endif /* THREADS_H_ */

View File

@@ -36,7 +36,7 @@
#include "libssh/socket.h"
#include "libssh/session.h"
#include "libssh/dh.h"
#include "libssh/threads.h"
#define set_status(session, status) do {\
if (session->callbacks && session->callbacks->connect_status_function) \
session->callbacks->connect_status_function(session->callbacks->userdata, status); \
@@ -680,7 +680,7 @@ int ssh_connect(ssh_session session) {
leave_function();
return SSH_ERROR;
}
ssh_log(session,SSH_LOG_RARE,"libssh %s, using threading %s", ssh_copyright(), ssh_threads_get_type());
session->ssh_connection_callback = ssh_client_connection_callback;
session->session_state=SSH_SESSION_STATE_CONNECTING;
ssh_socket_set_callbacks(session->socket,&session->socket_callbacks);
@@ -806,7 +806,7 @@ error:
const char *ssh_copyright(void) {
return SSH_STRINGIFY(LIBSSH_VERSION) " (c) 2003-2010 Aris Adamantiadis "
"(aris@0xbadc0de.be) Distributed under the LGPL, please refer to COPYING"
"(aris@0xbadc0de.be) Distributed under the LGPL, please refer to COPYING "
"file for information about your rights";
}
/** @} */

View File

@@ -49,7 +49,7 @@ struct ssh_threads_callbacks_struct ssh_threads_noop =
.thread_id=threads_id_noop
};
static struct ssh_threads_callbacks_struct *user_callbacks;
static struct ssh_threads_callbacks_struct *user_callbacks =&ssh_threads_noop;
#ifdef HAVE_LIBGCRYPT
@@ -158,6 +158,12 @@ int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct *cb){
return SSH_OK;
}
const char *ssh_threads_get_type(){
if(user_callbacks != NULL)
return user_callbacks->type;
return NULL;
}
/**
* @}
*/