From 7e5acaf50f25dd097e8225b0df6c4731c8730a63 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 4 Dec 2009 17:36:09 +0100 Subject: Give GnuTLS return code to callback if handshake has failed, display extra info in irc plugin if Diffie-Hellman prime sent by the server is not acceptable (not long enough) --- src/core/wee-hook.h | 1 + src/core/wee-network.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index 0f02778ca..67e94d6c4 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -181,6 +181,7 @@ struct t_hook_process /* hook connect */ typedef int (t_hook_callback_connect)(void *data, int status, + int gnutls_rc, const char *error, const char *ip_address); diff --git a/src/core/wee-network.c b/src/core/wee-network.c index 0e2059b74..15e475e3f 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -834,6 +834,7 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd) (void) (HOOK_CONNECT(hook_connect, callback)) (hook_connect->callback_data, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR, + rc, gnutls_strerror (rc), ip_address); unhook (hook_connect); @@ -845,7 +846,7 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd) #endif } (void) (HOOK_CONNECT(hook_connect, callback)) - (hook_connect->callback_data, buffer[0] - '0', NULL, ip_address); + (hook_connect->callback_data, buffer[0] - '0', 0, NULL, ip_address); unhook (hook_connect); } @@ -876,7 +877,7 @@ network_connect_with_fork (struct t_hook *hook_connect) (void) (HOOK_CONNECT(hook_connect, callback)) (hook_connect->callback_data, '0' + WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, - NULL, NULL); + 0, NULL, NULL); unhook (hook_connect); return; } @@ -899,7 +900,7 @@ network_connect_with_fork (struct t_hook *hook_connect) (void) (HOOK_CONNECT(hook_connect, callback)) (hook_connect->callback_data, '0' + WEECHAT_HOOK_CONNECT_MEMORY_ERROR, - NULL, NULL); + 0, NULL, NULL); unhook (hook_connect); return; } @@ -921,7 +922,7 @@ network_connect_with_fork (struct t_hook *hook_connect) (void) (HOOK_CONNECT(hook_connect, callback)) (hook_connect->callback_data, '0' + WEECHAT_HOOK_CONNECT_MEMORY_ERROR, - NULL, NULL); + 0, NULL, NULL); unhook (hook_connect); return; /* child process */ -- cgit v1.2.3