core: add a connection timeout for child process in hook_connect (bug #35966)

v2.8-utf8proc
Sebastien Helleu 2012-03-23 18:24:47 +01:00
parent 4474f9ca0e
commit 9972cce777
37 changed files with 248 additions and 19 deletions

View File

@ -1,12 +1,13 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.8-dev, 2012-03-21
v0.3.8-dev, 2012-03-23
Version 0.3.8 (under dev!)
--------------------------
* core: add a connection timeout for child process in hook_connect (bug #35966)
* core: follow symbolic links when writing configuration files (.conf)
(task #11779)
* core: fix lost scroll when switching to a buffer with a pending search

View File

@ -723,6 +723,11 @@
** Typ: Zeichenkette
** Werte: beliebige Zeichenkette (Standardwert: `"%a, %d %b %Y %T"`)
* [[option_weechat.network.connection_timeout]] *weechat.network.connection_timeout*
** Beschreibung: `timeout (in seconds) for connection to a remote host (made in a child process)`
** Typ: integer
** Werte: 1 .. 2147483647 (Standardwert: `60`)
* [[option_weechat.network.gnutls_ca_file]] *weechat.network.gnutls_ca_file*
** Beschreibung: `Datei beinhaltet die digitalen Zertifikate ("%h" wird durch das WeeChat Verzeichnis ersetzt, Standardverzeichnis: "~/.weechat")`
** Typ: Zeichenkette

View File

@ -391,7 +391,7 @@ Liste der Konstanten in Skript API:
WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND, WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED,
WEECHAT_HOOK_CONNECT_PROXY_ERROR, WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR
WEECHAT_HOOK_CONNECT_MEMORY_ERROR, WEECHAT_HOOK_CONNECT_TIMEOUT
| hook Signal |
WEECHAT_HOOK_SIGNAL_STRING, WEECHAT_HOOK_SIGNAL_INT, WEECHAT_HOOK_SIGNAL_POINTER
|========================================

View File

@ -723,6 +723,11 @@
** type: string
** values: any string (default value: `"%a, %d %b %Y %T"`)
* [[option_weechat.network.connection_timeout]] *weechat.network.connection_timeout*
** description: `timeout (in seconds) for connection to a remote host (made in a child process)`
** type: integer
** values: 1 .. 2147483647 (default value: `60`)
* [[option_weechat.network.gnutls_ca_file]] *weechat.network.gnutls_ca_file*
** description: `file containing the certificate authorities ("%h" will be replaced by WeeChat home, "~/.weechat" by default)`
** type: string

View File

@ -7090,6 +7090,7 @@ Arguments:
*** 'WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR': GnuTLS init error
*** 'WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR': GnuTLS handshake error
*** 'WEECHAT_HOOK_CONNECT_MEMORY_ERROR': insufficient memory
*** 'WEECHAT_HOOK_CONNECT_TIMEOUT': timeout
** 'gnutls_rc': result value of 'gnutls_handshake()'
** 'const char *error': result value of 'gnutls_strerror(gnutls_rc)'
** 'const char *ip_address': IP address found
@ -7139,6 +7140,9 @@ my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
case WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
/* ... */
break;
case WEECHAT_HOOK_CONNECT_TIMEOUT:
/* ... */
break;
}
return WEECHAT_RC_OK;
}
@ -7179,6 +7183,8 @@ def my_connect_cb(data, status, gnutls_rc, error, ip_address):
# ...
elif status == WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
# ...
elif status == WEECHAT_HOOK_CONNECT_TIMEOUT:
# ...
return weechat.WEECHAT_RC_OK
hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "",

View File

@ -385,7 +385,7 @@ List of constants in script API:
WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND, WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED,
WEECHAT_HOOK_CONNECT_PROXY_ERROR, WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR
WEECHAT_HOOK_CONNECT_MEMORY_ERROR, WEECHAT_HOOK_CONNECT_TIMEOUT
| hook signal |
WEECHAT_HOOK_SIGNAL_STRING, WEECHAT_HOOK_SIGNAL_INT, WEECHAT_HOOK_SIGNAL_POINTER
|========================================

View File

@ -723,6 +723,11 @@
** type: chaîne
** valeurs: toute chaîne (valeur par défaut: `"%a, %d %b %Y %T"`)
* [[option_weechat.network.connection_timeout]] *weechat.network.connection_timeout*
** description: `délai d'attente maximum (en secondes) pour la connexion à une machine distante (effectuée dans un processus fils)`
** type: entier
** valeurs: 1 .. 2147483647 (valeur par défaut: `60`)
* [[option_weechat.network.gnutls_ca_file]] *weechat.network.gnutls_ca_file*
** description: `fichier contenant les autorités de certification ("%h" sera remplacé par le répertoire de base WeeChat, par défaut: "~/.weechat")`
** type: chaîne

View File

@ -7196,6 +7196,7 @@ Paramètres :
*** 'WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR' : erreur avec la
"poignée de main" GnuTLS
*** 'WEECHAT_HOOK_CONNECT_MEMORY_ERROR' : mémoire insuffisante
*** 'WEECHAT_HOOK_CONNECT_TIMEOUT' : temps maximum dépassé
** 'gnutls_rc' : valeur retour de 'gnutls_handshake()'
** 'const char *error' : valeur retour de 'gnutls_strerror(gnutls_rc)'
** 'const char *ip_address' : adresse IP trouvée
@ -7246,6 +7247,9 @@ my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
case WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
/* ... */
break;
case WEECHAT_HOOK_CONNECT_TIMEOUT:
/* ... */
break;
}
return WEECHAT_RC_OK;
}
@ -7286,6 +7290,8 @@ def my_connect_cb(data, status, gnutls_rc, error, ip_address):
# ...
elif status == WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
# ...
elif status == WEECHAT_HOOK_CONNECT_TIMEOUT:
# ...
return weechat.WEECHAT_RC_OK
hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "",

View File

@ -394,7 +394,7 @@ Liste des constantes de l'API script :
WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND, WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED,
WEECHAT_HOOK_CONNECT_PROXY_ERROR, WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR
WEECHAT_HOOK_CONNECT_MEMORY_ERROR, WEECHAT_HOOK_CONNECT_TIMEOUT
| hook signal |
WEECHAT_HOOK_SIGNAL_STRING, WEECHAT_HOOK_SIGNAL_INT, WEECHAT_HOOK_SIGNAL_POINTER
|========================================

View File

@ -723,6 +723,11 @@
** tipo: stringa
** valori: qualsiasi stringa (valore predefinito: `"%a, %d %b %Y %T"`)
* [[option_weechat.network.connection_timeout]] *weechat.network.connection_timeout*
** descrizione: `timeout (in seconds) for connection to a remote host (made in a child process)`
** tipo: intero
** valori: 1 .. 2147483647 (valore predefinito: `60`)
* [[option_weechat.network.gnutls_ca_file]] *weechat.network.gnutls_ca_file*
** descrizione: `file contenente le autorità certificative ("%h" sarà sostituito dalla home di WeeChat, "~/.weechat come predefinita)`
** tipo: stringa

View File

@ -7114,6 +7114,8 @@ Argomenti:
*** 'WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR': errore inizializzazione GnuTLS
*** 'WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR': errore di handshake GnuTLS
*** 'WEECHAT_HOOK_CONNECT_MEMORY_ERROR': memoria insufficiente
// TRANSLATION MISSING
*** 'WEECHAT_HOOK_CONNECT_TIMEOUT': timeout
** 'gnutls_rc': valore del risultato di 'gnutls_handshake()'
** 'const char *error': valore del risultato di 'gnutls_strerror(gnutls_rc)'
** 'const char *ip_address': indirizzo IP trovato
@ -7163,6 +7165,9 @@ my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
case WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
/* ... */
break;
case WEECHAT_HOOK_CONNECT_TIMEOUT:
/* ... */
break;
}
return WEECHAT_RC_OK;
}
@ -7203,6 +7208,8 @@ def my_connect_cb(data, status, gnutls_rc, error, ip_address):
# ...
elif status == WEECHAT_HOOK_CONNECT_MEMORY_ERROR:
# ...
elif status == WEECHAT_HOOK_CONNECT_TIMEOUT:
# ...
return weechat.WEECHAT_RC_OK
hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "",

View File

@ -393,7 +393,7 @@ Elenco di costanti nelle API per gli script:
WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND, WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED,
WEECHAT_HOOK_CONNECT_PROXY_ERROR, WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR
WEECHAT_HOOK_CONNECT_MEMORY_ERROR, WEECHAT_HOOK_CONNECT_TIMEOUT
| hook su segnale |
WEECHAT_HOOK_SIGNAL_STRING, WEECHAT_HOOK_SIGNAL_INT, WEECHAT_HOOK_SIGNAL_POINTER
|========================================

View File

@ -383,7 +383,7 @@ Lista stałych w API skryptów:
WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND, WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED,
WEECHAT_HOOK_CONNECT_PROXY_ERROR, WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR
WEECHAT_HOOK_CONNECT_MEMORY_ERROR, WEECHAT_HOOK_CONNECT_TIMEOUT
| hook signal |
WEECHAT_HOOK_SIGNAL_STRING, WEECHAT_HOOK_SIGNAL_INT, WEECHAT_HOOK_SIGNAL_POINTER
|========================================

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2906,6 +2906,12 @@ msgstr ""
"maximální počet příkazů, který zobrazit jako výchozí v seznamu historie (0 = "
"nekonečno)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "časový limit (v sekundách) pro gnutls handshake"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6610,6 +6616,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: nedostatek paměti"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: vypršel časový limit \"%s\" pro %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-13 16:35+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-03-13 16:36+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@ -3200,6 +3200,12 @@ msgstr ""
"Wert für die maximale Anzahl der angezeigten Befehle im Verlaufsspeicher, "
"die mittels /history angezeigt werden (0: unbegrenzt)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "Zeitüberschreitung für gnutls handshake (in Sekunden)"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -7086,6 +7092,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: Nicht genügend Speicher"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: Zeitüberschreitung für \"%s\" mit %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3070,6 +3070,12 @@ msgstr ""
"número máximo de comandos para mostrar por defecto en el listado del "
"historial (0 = ilimitado)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "tiempo de espera (en segundos) para el saludo gnutls"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6845,6 +6851,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: no hay suficiente memoria"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: tiempo de espera máximo para \"%s\" con %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr "gnutls: conectado usando %d-bit Diffie-Hellman"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"PO-Revision-Date: 2012-03-12 10:28+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-03-23 13:29+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@ -3105,6 +3105,13 @@ msgstr ""
"nombre maximum de commandes à afficher par défaut dans le listing "
"d'historique (0 = sans limite)"
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr ""
"délai d'attente maximum (en secondes) pour la connexion à une machine "
"distante (effectuée dans un processus fils)"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6910,6 +6917,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: pas assez de mémoire"
#, c-format
msgid "%s%s: timeout"
msgstr "%s%s: délai d'attente dépassé"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2572,6 +2572,12 @@ msgstr ""
"megjeleníthető parancsok maximális száma előzmények listázásakor ( 0 = "
"korlátlan)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "SSL használata a a kapcsolathoz"
#, fuzzy
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
@ -6170,6 +6176,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "Nincs elég memória az új sorhoz\n"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3065,6 +3065,12 @@ msgstr ""
"numero massimo predefinito di comandi da visualizzare nella cronologia (0 = "
"nessun limite)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "timeout (in secondi) per l'handshake di gnutls"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6839,6 +6845,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: memoria non sufficiente"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: timeout per \"%s\" con %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: \"AYANOKOUZI, Ryuunosuke\" <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese\n"
@ -2985,6 +2985,12 @@ msgid ""
msgstr ""
"履歴をリストアップする際にデフォルトで表示するコマンドの最大数 (0 = 制限無し)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "gnutls ハンドシェイクのタイムアウト (秒単位)"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6672,6 +6678,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: メモリが足りません"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: \"%s\" のタイムアウト %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr "gnutls: %d-ビット Diffie-Hellman 共有鍵交換を使って接続中"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3061,6 +3061,12 @@ msgstr ""
"maksymalna ilość komend domyślnie wyświetlanych w listingu historii (0 = bez "
"ograniczeń)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "czas oczekiwania (w sekundach) na uwierzytelnienie gnutls"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6802,6 +6808,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: za mało pamięci"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: przekroczono czas na \"%s\" z %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr "gnutls: połączono używając %d-bitowego klucza Diffie-Hellmana"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3002,6 +3002,13 @@ msgstr ""
"número máximo de comandos para mostrar por padrão na listagem de histórico "
"(0 = ilimitado)"
# better not translate handshake
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "tempo de espera (em segundos) pelo handshake do gnutls"
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -6315,6 +6322,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "%s%s: memória insuficiente"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s%s: tempo esgotado para \"%s\" com %s"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.8-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+0100\n"
"PO-Revision-Date: 2012-02-26 09:16+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2596,6 +2596,12 @@ msgstr ""
"максимальное количество отображаемых команд в листинге истории (0 = не "
"ограничено)"
#, fuzzy
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr "использовать SSL при связи с сервером"
#, fuzzy
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
@ -6199,6 +6205,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr "Недостаточно памяти для новой строчки\n"
#, fuzzy, c-format
msgid "%s%s: timeout"
msgstr "%s нет аргумента для параметра \"%s\"\n"
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-03-12 10:27+0100\n"
"POT-Creation-Date: 2012-03-23 18:09+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"
@ -2246,6 +2246,11 @@ msgid ""
"unlimited)"
msgstr ""
msgid ""
"timeout (in seconds) for connection to a remote host (made in a child "
"process)"
msgstr ""
msgid ""
"file containing the certificate authorities (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"
@ -5392,6 +5397,10 @@ msgstr ""
msgid "%s%s: not enough memory"
msgstr ""
#, c-format
msgid "%s%s: timeout"
msgstr ""
#, c-format
msgid "gnutls: connected using %d-bit Diffie-Hellman shared secret exchange"
msgstr ""

View File

@ -227,6 +227,7 @@ struct t_config_option *config_history_display_default;
/* config, network section */
struct t_config_option *config_network_connection_timeout;
struct t_config_option *config_network_gnutls_ca_file;
struct t_config_option *config_network_gnutls_handshake_timeout;
@ -2645,6 +2646,12 @@ config_weechat_init_options ()
return 0;
}
config_network_connection_timeout = config_file_new_option (
weechat_config_file, ptr_section,
"connection_timeout", "integer",
N_("timeout (in seconds) for connection to a remote host (made in a "
"child process)"),
NULL, 1, INT_MAX, "60", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_network_gnutls_ca_file = config_file_new_option (
weechat_config_file, ptr_section,
"gnutls_ca_file", "string",

View File

@ -243,6 +243,7 @@ extern struct t_config_option *config_history_max_commands;
extern struct t_config_option *config_history_max_visited_buffers;
extern struct t_config_option *config_history_display_default;
extern struct t_config_option *config_network_connection_timeout;
extern struct t_config_option *config_network_gnutls_ca_file;
extern struct t_config_option *config_network_gnutls_handshake_timeout;

View File

@ -1763,6 +1763,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
new_hook_connect->child_read = -1;
new_hook_connect->child_write = -1;
new_hook_connect->child_pid = 0;
new_hook_connect->hook_child_timer = NULL;
new_hook_connect->hook_fd = NULL;
new_hook_connect->handshake_hook_fd = NULL;
new_hook_connect->handshake_hook_timer = NULL;
@ -3128,6 +3129,8 @@ unhook (struct t_hook *hook)
#endif
if (HOOK_CONNECT(hook, local_hostname))
free (HOOK_CONNECT(hook, local_hostname));
if (HOOK_CONNECT(hook, hook_child_timer))
unhook (HOOK_CONNECT(hook, hook_child_timer));
if (HOOK_CONNECT(hook, hook_fd))
unhook (HOOK_CONNECT(hook, hook_fd));
if (HOOK_CONNECT(hook, handshake_hook_fd))
@ -3471,6 +3474,8 @@ hook_add_to_infolist_type (struct t_infolist *infolist, int type,
return 0;
if (!infolist_new_var_integer (ptr_item, "child_pid", HOOK_CONNECT(ptr_hook, child_pid)))
return 0;
if (!infolist_new_var_pointer (ptr_item, "hook_child_timer", HOOK_CONNECT(ptr_hook, hook_child_timer)))
return 0;
if (!infolist_new_var_pointer (ptr_item, "hook_fd", HOOK_CONNECT(ptr_hook, hook_fd)))
return 0;
if (!infolist_new_var_pointer (ptr_item, "handshake_hook_fd", HOOK_CONNECT(ptr_hook, handshake_hook_fd)))
@ -3870,6 +3875,7 @@ hook_print_log ()
log_printf (" child_read. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read));
log_printf (" child_write . . . . . : %d", HOOK_CONNECT(ptr_hook, child_write));
log_printf (" child_pid . . . . . . : %d", HOOK_CONNECT(ptr_hook, child_pid));
log_printf (" hook_child_timer. . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_child_timer));
log_printf (" hook_fd . . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_fd));
log_printf (" handshake_hook_fd . . : 0x%lx", HOOK_CONNECT(ptr_hook, handshake_hook_fd));
log_printf (" handshake_hook_timer. : 0x%lx", HOOK_CONNECT(ptr_hook, handshake_hook_timer));

View File

@ -243,6 +243,7 @@ struct t_hook_connect
int child_read; /* to read data in pipe from child */
int child_write; /* to write data in pipe for child */
pid_t child_pid; /* pid of child process (connecting) */
struct t_hook *hook_child_timer; /* timer for child process timeout */
struct t_hook *hook_fd; /* pointer to fd hook */
struct t_hook *handshake_hook_fd; /* fd hook for handshake */
struct t_hook *handshake_hook_timer; /* timer for handshake timeout */

View File

@ -766,6 +766,31 @@ network_connect_child (struct t_hook *hook_connect)
freeaddrinfo (res_local);
}
/*
* network_connect_child_timer_cb: timer for timeout of child process
*/
int
network_connect_child_timer_cb (void *arg_hook_connect, int remaining_calls)
{
struct t_hook *hook_connect;
/* make C compiler happy */
(void) remaining_calls;
hook_connect = (struct t_hook *)arg_hook_connect;
HOOK_CONNECT(hook_connect, hook_child_timer) = NULL;
(void) (HOOK_CONNECT(hook_connect, callback))
(hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_TIMEOUT,
0, NULL, NULL);
unhook (hook_connect);
return WEECHAT_RC_OK;
}
/*
* network_connect_gnutls_handshake_fd_cb: callback for gnutls handshake
* (used to not block WeeChat if
@ -1098,6 +1123,11 @@ network_connect_with_fork (struct t_hook *hook_connect)
HOOK_CONNECT(hook_connect, child_pid) = pid;
close (HOOK_CONNECT(hook_connect, child_write));
HOOK_CONNECT(hook_connect, child_write) = -1;
HOOK_CONNECT(hook_connect, hook_child_timer) = hook_timer (hook_connect->plugin,
CONFIG_INTEGER(config_network_connection_timeout) * 1000,
0, 1,
&network_connect_child_timer_cb,
hook_connect);
HOOK_CONNECT(hook_connect, hook_fd) = hook_fd (hook_connect->plugin,
HOOK_CONNECT(hook_connect, child_read),
1, 0, 0,

View File

@ -3022,6 +3022,20 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc,
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
break;
case WEECHAT_HOOK_CONNECT_TIMEOUT:
weechat_printf (server->buffer,
_("%s%s: timeout"),
weechat_prefix ("error"), IRC_PLUGIN_NAME);
if (error && error[0])
{
weechat_printf (server->buffer,
_("%s%s: error: %s"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
error);
}
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
break;
}
return WEECHAT_RC_OK;

View File

@ -5446,6 +5446,7 @@ weechat_guile_api_module_init (void *data)
scm_c_define ("weechat:WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", scm_from_int (WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
scm_c_define ("weechat:WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", scm_from_int (WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
scm_c_define ("weechat:WEECHAT_HOOK_CONNECT_MEMORY_ERROR", scm_from_int (WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
scm_c_define ("weechat:WEECHAT_HOOK_CONNECT_TIMEOUT", scm_from_int (WEECHAT_HOOK_CONNECT_TIMEOUT));
scm_c_define ("weechat:WEECHAT_HOOK_SIGNAL_STRING", scm_from_locale_string (WEECHAT_HOOK_SIGNAL_STRING));
scm_c_define ("weechat:WEECHAT_HOOK_SIGNAL_INT", scm_from_locale_string (WEECHAT_HOOK_SIGNAL_INT));
@ -5486,6 +5487,7 @@ weechat_guile_api_module_init (void *data)
"weechat:WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR",
"weechat:WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR",
"weechat:WEECHAT_HOOK_CONNECT_MEMORY_ERROR",
"weechat:WEECHAT_HOOK_CONNECT_TIMEOUT",
"weechat:WEECHAT_HOOK_SIGNAL_STRING",
"weechat:WEECHAT_HOOK_SIGNAL_INT",
"weechat:WEECHAT_HOOK_SIGNAL_POINTER",

View File

@ -6130,6 +6130,16 @@ weechat_lua_api_constant_weechat_hook_connect_memory_error (lua_State *L)
return 1;
}
static int
weechat_lua_api_constant_weechat_hook_connect_timeout (lua_State *L)
{
/* make C compiler happy */
(void) L;
lua_pushnumber (lua_current_interpreter, WEECHAT_HOOK_CONNECT_TIMEOUT);
return 1;
}
static int
weechat_lua_api_constant_weechat_hook_signal_string (lua_State *L)
{
@ -6389,6 +6399,7 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
{ "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", &weechat_lua_api_constant_weechat_hook_connect_gnutls_init_error },
{ "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", &weechat_lua_api_constant_weechat_hook_connect_gnutls_handshake_error },
{ "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", &weechat_lua_api_constant_weechat_hook_connect_memory_error },
{ "WEECHAT_HOOK_CONNECT_TIMEOUT", &weechat_lua_api_constant_weechat_hook_connect_timeout },
{ "WEECHAT_HOOK_SIGNAL_STRING", &weechat_lua_api_constant_weechat_hook_signal_string },
{ "WEECHAT_HOOK_SIGNAL_INT", &weechat_lua_api_constant_weechat_hook_signal_int },

View File

@ -5743,6 +5743,7 @@ weechat_perl_api_init (pTHX)
newCONSTSUB (stash, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", newSViv (WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
newCONSTSUB (stash, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", newSViv (WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
newCONSTSUB (stash, "weechat::WEECHAT_HOOK_CONNECT_MEMORY_ERROR", newSViv (WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
newCONSTSUB (stash, "weechat::WEECHAT_HOOK_CONNECT_TIMEOUT", newSViv (WEECHAT_HOOK_CONNECT_TIMEOUT));
newCONSTSUB (stash, "weechat::WEECHAT_HOOK_SIGNAL_STRING", newSVpv (WEECHAT_HOOK_SIGNAL_STRING, PL_na));
newCONSTSUB (stash, "weechat::WEECHAT_HOOK_SIGNAL_INT", newSVpv (WEECHAT_HOOK_SIGNAL_INT, PL_na));

View File

@ -546,6 +546,7 @@ void weechat_python_init_module_weechat ()
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_CONNECT_TIMEOUT", PyLong_FromLong((long) WEECHAT_HOOK_CONNECT_TIMEOUT));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_SIGNAL_STRING", PyUnicode_FromString(WEECHAT_HOOK_SIGNAL_STRING));
PyDict_SetItemString(weechat_dict, "WEECHAT_HOOK_SIGNAL_INT", PyUnicode_FromString(WEECHAT_HOOK_SIGNAL_INT));

View File

@ -6600,6 +6600,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_MEMORY_ERROR", INT2NUM(WEECHAT_HOOK_CONNECT_MEMORY_ERROR));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_CONNECT_TIMEOUT", INT2NUM(WEECHAT_HOOK_CONNECT_TIMEOUT));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_STRING", rb_str_new2(WEECHAT_HOOK_SIGNAL_STRING));
rb_define_const(ruby_mWeechat, "WEECHAT_HOOK_SIGNAL_INT", rb_str_new2(WEECHAT_HOOK_SIGNAL_INT));

View File

@ -6331,6 +6331,8 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", Tcl_GetStringFromObj (objp, &i), 0);
Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_MEMORY_ERROR);
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_MEMORY_ERROR", Tcl_GetStringFromObj (objp, &i), 0);
Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_TIMEOUT);
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_TIMEOUT", Tcl_GetStringFromObj (objp, &i), 0);
Tcl_SetStringObj (objp, WEECHAT_HOOK_SIGNAL_STRING, -1);
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_STRING", Tcl_GetStringFromObj (objp, &i), 0);

View File

@ -46,7 +46,7 @@ struct timeval;
*/
/* API version (used to check that plugin has same API and can be loaded) */
#define WEECHAT_PLUGIN_API_VERSION "20120122-01"
#define WEECHAT_PLUGIN_API_VERSION "20120323-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@ -137,6 +137,7 @@ struct timeval;
#define WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR 6
#define WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR 7
#define WEECHAT_HOOK_CONNECT_MEMORY_ERROR 8
#define WEECHAT_HOOK_CONNECT_TIMEOUT 9
/* action for gnutls callback: verify or set certificate */
#define WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT 0