mirror of
https://github.com/weechat/weechat.git
synced 2026-06-24 03:46:39 +02:00
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)
This commit is contained in:
@@ -3135,11 +3135,12 @@ weechat_python_api_hook_process (PyObject *self, PyObject *args)
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_python_api_hook_connect_cb (void *data, int status,
|
||||
weechat_python_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 *python_argv[5], str_status[32], empty_arg[1] = { '\0' };
|
||||
char *python_argv[6], str_status[32], str_gnutls_rc[32];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3147,12 +3148,14 @@ weechat_python_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);
|
||||
|
||||
python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
python_argv[1] = str_status;
|
||||
python_argv[2] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
python_argv[3] = (error) ? (char *)error : empty_arg;
|
||||
python_argv[4] = NULL;
|
||||
python_argv[2] = str_gnutls_rc;
|
||||
python_argv[3] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
python_argv[4] = (error) ? (char *)error : empty_arg;
|
||||
python_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_python_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
|
||||
Reference in New Issue
Block a user