mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 17:23:15 +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:
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-09-14 10:56+0200\n"
|
||||
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@@ -4594,6 +4594,12 @@ msgstr "%s%s: chyba inicializace TLS"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s%s: TLS handshake selhal"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "%s%s: nedostatek paměti"
|
||||
|
||||
@@ -10,7 +10,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-11-26 18:51+0100\n"
|
||||
"Last-Translator: Nils G <weechatter@arcor.de>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@@ -4731,6 +4731,12 @@ msgstr "%s%s: TLS Initialisierungsfehler"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s%s: TLS Handshake fehlgeschlagen"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "%s%s: Nicht genügend Speicher"
|
||||
|
||||
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-09-06 21:25+0200\n"
|
||||
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@@ -4511,6 +4511,12 @@ msgstr "%s%s: error de inicialización de TLS"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s%s: el saludo TLS ha fallado"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "%s%s: no hay suficiente memoria"
|
||||
|
||||
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"PO-Revision-Date: 2009-12-02 12:07+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-12-04 17:13+0100\n"
|
||||
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -4688,6 +4688,14 @@ msgstr "%s%s: erreur d'initialisation TLS"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s%s: la poignée de main (handshake) de TLS a échoué"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
"%s%s: vous devriez jouer avec l'option irc.server.%s.ssl_dhkey_size (la "
|
||||
"valeur actuelle est %d)"
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "%s%s: pas assez de mémoire"
|
||||
|
||||
@@ -12,7 +12,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-09-20 13:51+0200\n"
|
||||
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@@ -4530,6 +4530,12 @@ msgstr "%s gnutls inicializációs hiba\n"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s gnutls kézfogás sikertelen\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "Nincs elég memória az új sorhoz\n"
|
||||
|
||||
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Weechat 0.31-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-11-26 01:26+0100\n"
|
||||
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@@ -4659,6 +4659,12 @@ msgstr "%s%s: errore avvio TLS"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s%s: handshake TLS fallito"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "%s%s: memoria non sufficiente"
|
||||
|
||||
@@ -9,7 +9,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-09-06 21:25+0200\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
|
||||
"Language-Team: Polish\n"
|
||||
@@ -4644,6 +4644,12 @@ msgstr "%s%s:błąd inicjalizacji TLS"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s%s: nawiązanie połączenia TLS nie powiodło się"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "%s%s: za mało pamięci"
|
||||
|
||||
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: 2009-09-20 13:50+0200\n"
|
||||
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@@ -4538,6 +4538,12 @@ msgstr "%s ошибка инициализации gnutls\n"
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr "%s инициализация gnutls не удалось\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr "Недостаточно памяти для новой строчки\n"
|
||||
|
||||
+7
-1
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-12-02 12:06+0100\n"
|
||||
"POT-Creation-Date: 2009-12-04 17:12+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -3895,6 +3895,12 @@ msgstr ""
|
||||
msgid "%s%s: TLS handshake failed"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s%s: you should play with option irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s%s: not enough memory"
|
||||
msgstr ""
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -1909,8 +1909,8 @@ irc_server_switch_address (struct t_irc_server *server)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_server_connect_cb (void *arg_server, int status, const char *error,
|
||||
const char *ip_address)
|
||||
irc_server_connect_cb (void *arg_server, int status, int gnutls_rc,
|
||||
const char *error, const char *ip_address)
|
||||
{
|
||||
struct t_irc_server *server;
|
||||
const char *proxy;
|
||||
@@ -2045,6 +2045,17 @@ irc_server_connect_cb (void *arg_server, int status, const char *error,
|
||||
weechat_prefix ("error"), IRC_PLUGIN_NAME,
|
||||
error);
|
||||
}
|
||||
if (gnutls_rc == GNUTLS_E_DH_PRIME_UNACCEPTABLE)
|
||||
{
|
||||
weechat_printf (server->buffer,
|
||||
_("%s%s: you should play with option "
|
||||
"irc.server.%s.ssl_dhkey_size (current "
|
||||
"value is %d)"),
|
||||
weechat_prefix ("error"), IRC_PLUGIN_NAME,
|
||||
server->name,
|
||||
IRC_SERVER_OPTION_INTEGER (server,
|
||||
IRC_SERVER_OPTION_SSL_DHKEY_SIZE));
|
||||
}
|
||||
irc_server_close_connection (server);
|
||||
irc_server_switch_address (server);
|
||||
break;
|
||||
|
||||
@@ -3523,11 +3523,12 @@ weechat_lua_api_hook_process (lua_State *L)
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_lua_api_hook_connect_cb (void *data, int status,
|
||||
weechat_lua_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 *lua_argv[5], str_status[32], empty_arg[1] = { '\0' };
|
||||
char *lua_argv[6], str_status[32], str_gnutls_rc[32];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3535,12 +3536,14 @@ weechat_lua_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);
|
||||
|
||||
lua_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
lua_argv[1] = str_status;
|
||||
lua_argv[2] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
lua_argv[3] = (error) ? (char *)error : empty_arg;
|
||||
lua_argv[4] = NULL;
|
||||
lua_argv[2] = str_gnutls_rc;
|
||||
lua_argv[3] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
lua_argv[4] = (error) ? (char *)error : empty_arg;
|
||||
lua_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_lua_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
|
||||
@@ -2968,11 +2968,12 @@ XS (XS_weechat_api_hook_process)
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_perl_api_hook_connect_cb (void *data, int status,
|
||||
weechat_perl_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 *perl_argv[5], str_status[32], empty_arg[1] = { '\0' };
|
||||
char *perl_argv[6], str_status[32], str_gnutls_rc[32];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -2980,12 +2981,14 @@ weechat_perl_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);
|
||||
|
||||
perl_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
perl_argv[1] = str_status;
|
||||
perl_argv[2] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
perl_argv[3] = (error) ? (char *)error : empty_arg;
|
||||
perl_argv[4] = NULL;
|
||||
perl_argv[2] = str_gnutls_rc;
|
||||
perl_argv[3] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
perl_argv[4] = (error) ? (char *)error : empty_arg;
|
||||
perl_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_perl_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -3620,11 +3620,12 @@ weechat_ruby_api_hook_process (VALUE class, VALUE command, VALUE timeout,
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_ruby_api_hook_connect_cb (void *data, int status,
|
||||
weechat_ruby_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 *ruby_argv[5], str_status[32], empty_arg[1] = { '\0' };
|
||||
char *ruby_argv[6], str_status[32], str_gnutls_rc[32];
|
||||
char empty_arg[1] = { '\0' };
|
||||
int *rc, ret;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -3632,12 +3633,14 @@ weechat_ruby_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);
|
||||
|
||||
ruby_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
|
||||
ruby_argv[1] = str_status;
|
||||
ruby_argv[2] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
ruby_argv[3] = (error) ? (char *)error : empty_arg;
|
||||
ruby_argv[4] = NULL;
|
||||
ruby_argv[2] = str_gnutls_rc;
|
||||
ruby_argv[3] = (ip_address) ? (char *)ip_address : empty_arg;
|
||||
ruby_argv[4] = (error) ? (char *)error : empty_arg;
|
||||
ruby_argv[5] = NULL;
|
||||
|
||||
rc = (int *) weechat_ruby_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
|
||||
@@ -929,6 +929,7 @@ script_api_hook_connect (struct t_weechat_plugin *weechat_plugin,
|
||||
void *gnutls_cb, int gnutls_dhkey_size,
|
||||
const char *local_hostname,
|
||||
int (*callback)(void *data, int status,
|
||||
int gnutls_rc,
|
||||
const char *error,
|
||||
const char *ip_address),
|
||||
const char *function,
|
||||
|
||||
@@ -174,6 +174,7 @@ extern struct t_hook *script_api_hook_connect (struct t_weechat_plugin *weechat_
|
||||
const char *local_hostname,
|
||||
int (*callback)(void *data,
|
||||
int status,
|
||||
int gnutls_rc,
|
||||
const char *error,
|
||||
const char *ip_address),
|
||||
const char *function,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -34,7 +34,7 @@ struct t_weelist;
|
||||
struct timeval;
|
||||
|
||||
/* API version (used to check that plugin has same API and can be loaded) */
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20091107-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20091204-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -401,6 +401,7 @@ struct t_weechat_plugin
|
||||
const char *local_hostname,
|
||||
int (*callback)(void *data,
|
||||
int status,
|
||||
int gnutls_rc,
|
||||
const char *error,
|
||||
const char *ip_address),
|
||||
void *callback_data);
|
||||
|
||||
Reference in New Issue
Block a user