Can't use the legacy logging callbacks of libssh, it's broken

This commit is contained in:
Nicolas Viennot 2013-11-06 19:07:47 -05:00
parent a37b7d1ae5
commit 92bf230b8a
2 changed files with 7 additions and 8 deletions

View File

@ -100,8 +100,15 @@ static void lookup_and_connect(void)
&hints, dns_cb, tmate_server_host); &hints, dns_cb, tmate_server_host);
} }
static void ssh_log_function(int priority, const char *function,
const char *buffer, void *userdata)
{
tmate_debug("[%d] [%s] %s", priority, function, buffer);
}
void tmate_session_init(void) void tmate_session_init(void)
{ {
ssh_set_log_callback(ssh_log_function);
tmate_catch_sigsegv(); tmate_catch_sigsegv();
tmate_encoder_init(&tmate_session.encoder); tmate_encoder_init(&tmate_session.encoder);

View File

@ -16,13 +16,6 @@ static void printflike2 reconnect_session(struct tmate_ssh_client *client,
const char *fmt, ...); const char *fmt, ...);
static void on_session_event(struct tmate_ssh_client *client); static void on_session_event(struct tmate_ssh_client *client);
static void log_function(ssh_session session, int priority,
const char *message, void *userdata)
{
struct tmate_ssh_client *client = userdata;
tmate_debug("[%s] [%d] %s", client->server_ip, priority, message);
}
static void register_session_fd_event(struct tmate_ssh_client *client) static void register_session_fd_event(struct tmate_ssh_client *client)
{ {
if (!event_initialized(&client->ev_ssh)) { if (!event_initialized(&client->ev_ssh)) {
@ -479,7 +472,6 @@ struct tmate_ssh_client *tmate_ssh_client_alloc(struct tmate_session *session,
memset(&client->ssh_callbacks, 0, sizeof(client->ssh_callbacks)); memset(&client->ssh_callbacks, 0, sizeof(client->ssh_callbacks));
ssh_callbacks_init(&client->ssh_callbacks); ssh_callbacks_init(&client->ssh_callbacks);
client->ssh_callbacks.log_function = log_function;
client->ssh_callbacks.userdata = client; client->ssh_callbacks.userdata = client;
client->ssh_callbacks.auth_function = passphrase_callback; client->ssh_callbacks.auth_function = passphrase_callback;