aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-09-12 21:53:42 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-09-12 21:53:42 +0200
commit5eb7c7b6ec8c82d9f5908e53f9014b844f628994 (patch)
tree6e0a67435952d9c2c9d444869c7eebf4673331c4
parentb7af2b29594a19dec5f71eb9412bd2a7a5b1e9ac (diff)
downloadlibssh-5eb7c7b6ec8c82d9f5908e53f9014b844f628994.tar.gz
libssh-5eb7c7b6ec8c82d9f5908e53f9014b844f628994.tar.xz
libssh-5eb7c7b6ec8c82d9f5908e53f9014b844f628994.zip
Added initialisation logs for threading
-rw-r--r--include/libssh/threads.h3
-rw-r--r--src/client.c6
-rw-r--r--src/threads.c8
3 files changed, 12 insertions, 5 deletions
diff --git a/include/libssh/threads.h b/include/libssh/threads.h
index 78149d90..b8fdffce 100644
--- a/include/libssh/threads.h
+++ b/include/libssh/threads.h
@@ -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_ */
diff --git a/src/client.c b/src/client.c
index d12aa117..fcdc87d1 100644
--- a/src/client.c
+++ b/src/client.c
@@ -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";
}
/** @} */
diff --git a/src/threads.c b/src/threads.c
index af69eeb4..ce82c6cc 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -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;
+}
+
/**
* @}
*/