diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-12-04 17:36:09 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-12-04 17:36:09 +0100 |
commit | 7e5acaf50f25dd097e8225b0df6c4731c8730a63 (patch) | |
tree | b625584236ec23fcd11c4f37a845f41243d64859 /src/plugins/scripts/tcl | |
parent | da6b882ed82b9e902df5649c326ecfa7ddae4d84 (diff) | |
download | weechat-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/plugins/scripts/tcl')
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl-api.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 04a654475..63701f3e1 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -3375,11 +3375,12 @@ weechat_tcl_api_hook_process (ClientData clientData, Tcl_Interp *interp, */ int -weechat_tcl_api_hook_connect_cb (void *data, int status, +weechat_tcl_api_hook_connect_cb (void *data, int status, int gnutls_rc, const char *error, const char *ip_address) { struct t_script_callback *script_callback; - char *tcl_argv[5], str_status[32], empty_arg[1] = { '\0' }; + char *tcl_argv[6], str_status[32], str_gnutls_rc[32]; + char empty_arg[1] = { '\0' }; int *rc, ret; script_callback = (struct t_script_callback *)data; @@ -3387,12 +3388,14 @@ weechat_tcl_api_hook_connect_cb (void *data, int status, if (script_callback && script_callback->function && script_callback->function[0]) { snprintf (str_status, sizeof (str_status), "%d", status); + snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); tcl_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; tcl_argv[1] = str_status; - tcl_argv[2] = (ip_address) ? (char *)ip_address : empty_arg; - tcl_argv[3] = (error) ? (char *)error : empty_arg; - tcl_argv[4] = NULL; + tcl_argv[2] = str_gnutls_rc; + tcl_argv[3] = (ip_address) ? (char *)ip_address : empty_arg; + tcl_argv[4] = (error) ? (char *)error : empty_arg; + tcl_argv[5] = NULL; rc = (int *) weechat_tcl_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, |