summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-12-04 17:36:09 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-12-04 17:36:09 +0100
commit7e5acaf50f25dd097e8225b0df6c4731c8730a63 (patch)
treeb625584236ec23fcd11c4f37a845f41243d64859 /src/core
parentda6b882ed82b9e902df5649c326ecfa7ddae4d84 (diff)
downloadweechat-7e5acaf50f25dd097e8225b0df6c4731c8730a63.zip
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)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-hook.h1
-rw-r--r--src/core/wee-network.c9
2 files changed, 6 insertions, 4 deletions
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 */