diff options
Diffstat (limited to 'libssh')
-rw-r--r-- | libssh/log.c | 3 | ||||
-rw-r--r-- | libssh/options.c | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/libssh/log.c b/libssh/log.c index b2f5f415..4a3b275b 100644 --- a/libssh/log.c +++ b/libssh/log.c @@ -56,7 +56,8 @@ void ssh_log(SSH_SESSION *session, int verbosity, const char *format, ...) { va_end(va); if (session->options->log_function) { - session->options->log_function(buffer, session, verbosity); + session->options->log_function(session, verbosity, buffer, + session->options->log_userdata); } else if (verbosity == SSH_LOG_FUNCTIONS) { if (session->log_indent > 255) { min = 255; diff --git a/libssh/options.c b/libssh/options.c index 755ef505..0fa3e895 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -762,13 +762,14 @@ int ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow) { * * @warning The message string may contain format string characters. */ -int ssh_options_set_log_function(SSH_OPTIONS *opt, - void (*callback)(const char *message, SSH_SESSION *session, int priority)) { - if (opt == NULL || callback == NULL) { +int ssh_options_set_log_function(SSH_OPTIONS *opt, ssh_log_callback cb, + void *userdata) { + if (opt == NULL || cb == NULL) { return -1; } - opt->log_function = callback; + opt->log_function = cb; + opt->log_userdata = userdata; return 0; } |