From c35c941298c16520293c4f6c85b140fd11d9bdd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 24 Aug 2015 13:26:59 +0200 Subject: [PATCH] script: add option script.scripts.download_timeout --- ChangeLog.asciidoc | 1 + doc/de/autogen/user/script_options.asciidoc | 5 +++++ doc/en/autogen/user/script_options.asciidoc | 5 +++++ doc/fr/autogen/user/script_options.asciidoc | 5 +++++ doc/it/autogen/user/script_options.asciidoc | 5 +++++ doc/ja/autogen/user/script_options.asciidoc | 5 +++++ doc/pl/autogen/user/script_options.asciidoc | 5 +++++ po/cs.po | 6 +++++- po/de.po | 8 +++++++- po/es.po | 8 +++++++- po/fr.po | 9 +++++++-- po/hu.po | 6 +++++- po/it.po | 8 +++++++- po/ja.po | 6 +++++- po/pl.po | 8 +++++++- po/pt_BR.po | 7 ++++++- po/ru.po | 6 +++++- po/tr.po | 5 ++++- po/weechat.pot | 5 ++++- src/plugins/script/script-action.c | 18 ++++++++++++------ src/plugins/script/script-config.c | 7 +++++++ src/plugins/script/script-config.h | 1 + src/plugins/script/script-repo.c | 9 ++++++--- 23 files changed, 126 insertions(+), 22 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 77c20be06..d7d832666 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -24,6 +24,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * irc: add command /cap (issue #8) * irc: add hex dump of messages in raw buffer when debug is enabled for irc plugin (level 2 or more) +* script: add option script.scripts.download_timeout === Bugs fixed diff --git a/doc/de/autogen/user/script_options.asciidoc b/doc/de/autogen/user/script_options.asciidoc index 3af4207f9..e993cba66 100644 --- a/doc/de/autogen/user/script_options.asciidoc +++ b/doc/de/autogen/user/script_options.asciidoc @@ -182,6 +182,11 @@ ** Typ: integer ** Werte: -1 .. 525600 (Standardwert: `1440`) +* [[option_script.scripts.download_timeout]] *script.scripts.download_timeout* +** Beschreibung: `timeout (in seconds) for download of scripts and list of scripts` +** Typ: integer +** Werte: 1 .. 3600 (Standardwert: `30`) + * [[option_script.scripts.hold]] *script.scripts.hold* ** Beschreibung: `Skripten welche "gehalten" werden sollen. Dies ist eine durch Kommata getrennte Liste von Skripten die weder aktualisiert noch entfernt werden können. Zum Beispiel: "buffers.pl,iset.pl"` ** Typ: Zeichenkette diff --git a/doc/en/autogen/user/script_options.asciidoc b/doc/en/autogen/user/script_options.asciidoc index 7d1fd19de..1272edb11 100644 --- a/doc/en/autogen/user/script_options.asciidoc +++ b/doc/en/autogen/user/script_options.asciidoc @@ -182,6 +182,11 @@ ** type: integer ** values: -1 .. 525600 (default value: `1440`) +* [[option_script.scripts.download_timeout]] *script.scripts.download_timeout* +** description: `timeout (in seconds) for download of scripts and list of scripts` +** type: integer +** values: 1 .. 3600 (default value: `30`) + * [[option_script.scripts.hold]] *script.scripts.hold* ** description: `scripts to "hold": comma-separated list of scripts which will never been upgraded and can not be removed, for example: "buffers.pl,iset.pl"` ** type: string diff --git a/doc/fr/autogen/user/script_options.asciidoc b/doc/fr/autogen/user/script_options.asciidoc index 0122a9605..4a7c672ce 100644 --- a/doc/fr/autogen/user/script_options.asciidoc +++ b/doc/fr/autogen/user/script_options.asciidoc @@ -182,6 +182,11 @@ ** type: entier ** valeurs: -1 .. 525600 (valeur par défaut: `1440`) +* [[option_script.scripts.download_timeout]] *script.scripts.download_timeout* +** description: `délai d'attente maximum (en secondes) pour le téléchargement des scripts et de la liste des scripts` +** type: entier +** valeurs: 1 .. 3600 (valeur par défaut: `30`) + * [[option_script.scripts.hold]] *script.scripts.hold* ** description: `scripts à "figer" : liste de scripts séparés par des virgules qui ne seront jamais mis à jour et ne peuvent pas être supprimés, par exemple : "buffers.pl,iset.pl"` ** type: chaîne diff --git a/doc/it/autogen/user/script_options.asciidoc b/doc/it/autogen/user/script_options.asciidoc index eaca960d7..aceeb2ee7 100644 --- a/doc/it/autogen/user/script_options.asciidoc +++ b/doc/it/autogen/user/script_options.asciidoc @@ -182,6 +182,11 @@ ** tipo: intero ** valori: -1 .. 525600 (valore predefinito: `1440`) +* [[option_script.scripts.download_timeout]] *script.scripts.download_timeout* +** descrizione: `timeout (in seconds) for download of scripts and list of scripts` +** tipo: intero +** valori: 1 .. 3600 (valore predefinito: `30`) + * [[option_script.scripts.hold]] *script.scripts.hold* ** descrizione: `scripts to "hold": comma-separated list of scripts which will never been upgraded and can not be removed, for example: "buffers.pl,iset.pl"` ** tipo: stringa diff --git a/doc/ja/autogen/user/script_options.asciidoc b/doc/ja/autogen/user/script_options.asciidoc index 072d77c17..578880d4b 100644 --- a/doc/ja/autogen/user/script_options.asciidoc +++ b/doc/ja/autogen/user/script_options.asciidoc @@ -182,6 +182,11 @@ ** タイプ: 整数 ** 値: -1 .. 525600 (デフォルト値: `1440`) +* [[option_script.scripts.download_timeout]] *script.scripts.download_timeout* +** 説明: `timeout (in seconds) for download of scripts and list of scripts` +** タイプ: 整数 +** 値: 1 .. 3600 (デフォルト値: `30`) + * [[option_script.scripts.hold]] *script.scripts.hold* ** 説明: `"ホールド" するスクリプト: コンマ区切りのスクリプトリスト、このリストに含まれるスクリプトはアップグレードされませんし、削除もされません、例: "buffers.pl,iset.pl"` ** タイプ: 文字列 diff --git a/doc/pl/autogen/user/script_options.asciidoc b/doc/pl/autogen/user/script_options.asciidoc index becfaa9d8..6f4eb3b5f 100644 --- a/doc/pl/autogen/user/script_options.asciidoc +++ b/doc/pl/autogen/user/script_options.asciidoc @@ -182,6 +182,11 @@ ** typ: liczba ** wartości: -1 .. 525600 (domyślna wartość: `1440`) +* [[option_script.scripts.download_timeout]] *script.scripts.download_timeout* +** opis: `timeout (in seconds) for download of scripts and list of scripts` +** typ: liczba +** wartości: 1 .. 3600 (domyślna wartość: `30`) + * [[option_script.scripts.hold]] *script.scripts.hold* ** opis: `skrypty do "wstrzymania": oddzielona przecinkami lista skryptów, które nigdy nie zostaną zaktualizowane i nie mogą być usunięte, na przykład: "buffers.pl,iset.pl"` ** typ: ciąg diff --git a/po/cs.po b/po/cs.po index d245f4729..d8c181595 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-08-15 22:22+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -10218,6 +10218,10 @@ msgid "" "expire)" msgstr "" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "časový limit (v sekundách) pro gnutls handshake" + #, fuzzy msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " diff --git a/po/de.po b/po/de.po index 2c2abd8a0..4a1bc41c9 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-08-24 11:25+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German <>\n" @@ -11633,6 +11633,12 @@ msgstr "" "Ablaufdatum des lokalen Caches, in Minuten (-1 = ohne Ablaufdatum, 0 = " "umgehend)" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" +"Zeitüberschreitung (in Sekunden) für eine Verbindung zu einem entfernten " +"Rechner (mittels einem Kindprozess)" + msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " "by WeeChat home (\"~/.weechat\" by default) (note: content is evaluated, " diff --git a/po/es.po b/po/es.po index e70434cbd..62fb34cc7 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-07-26 09:41+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -10500,6 +10500,12 @@ msgid "" "expire)" msgstr "" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" +"tiempo de espera (en segundos) para la conexión al servidor remoto (por un " +"subproceso)" + #, fuzzy msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " diff --git a/po/fr.po b/po/fr.po index 562bde5e5..419b66ed1 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" -"PO-Revision-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" +"PO-Revision-Date: 2015-08-24 13:25+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -11367,6 +11367,11 @@ msgstr "" "temps d'expiration du cache local, en minutes (-1 = n'expire jamais, 0 = " "expire toujours)" +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" +"délai d'attente maximum (en secondes) pour le téléchargement des scripts et " +"de la liste des scripts" + msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " "by WeeChat home (\"~/.weechat\" by default) (note: content is evaluated, " diff --git a/po/hu.po b/po/hu.po index 27721e470..936f87ede 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-07-26 09:42+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -9559,6 +9559,10 @@ msgid "" "expire)" msgstr "" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "SSL használata a a kapcsolathoz" + #, fuzzy msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " diff --git a/po/it.po b/po/it.po index 9ea2eb27e..25ec091e5 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-07-26 09:42+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -10687,6 +10687,12 @@ msgid "" "expire)" msgstr "" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" +"timeout (in secondi) per la connessione ad un host remoto (eseguita in un " +"processo figlio)" + #, fuzzy msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " diff --git a/po/ja.po b/po/ja.po index 292c56a83..b1754fd32 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-08-22 09:00+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -10924,6 +10924,10 @@ msgstr "" "ローカルキャッシュが無効になる時間、分単位 (-1 = 再取得しない、0 = 常に再取" "得)" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "リモートホストへの接続タイムアウト時間 (秒単位) (子プロセスが行う)" + msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " "by WeeChat home (\"~/.weechat\" by default) (note: content is evaluated, " diff --git a/po/pl.po b/po/pl.po index 508fc7bf2..0c396f4e1 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-08-14 17:54+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -11116,6 +11116,12 @@ msgstr "" "lokalnie zapisany czas wygaśnięcia, w minutach (-1 = nigdy nie wygasa, 0 = " "zawsze wygasa)" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" +"czas oczekiwania (w sekundach) na połączenie ze zdalnym serwerem (wykonywane " +"w procesie potomnym)" + msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " "by WeeChat home (\"~/.weechat\" by default) (note: content is evaluated, " diff --git a/po/pt_BR.po b/po/pt_BR.po index 8e6d3fb1a..985738063 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-07-26 09:42+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -9989,6 +9989,11 @@ msgid "" "expire)" msgstr "" +# better not translate handshake +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "tempo de espera (em segundos) pelo handshake do gnutls" + #, fuzzy msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " diff --git a/po/ru.po b/po/ru.po index 2b6372b32..65260fa7d 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-07-26 09:42+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -9589,6 +9589,10 @@ msgid "" "expire)" msgstr "" +#, fuzzy +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "использовать SSL при связи с сервером" + #, fuzzy msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " diff --git a/po/tr.po b/po/tr.po index 4b2394a7c..1bcf0c9df 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2015-03-10 21:33+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -8659,6 +8659,9 @@ msgid "" "expire)" msgstr "" +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" + msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " "by WeeChat home (\"~/.weechat\" by default) (note: content is evaluated, " diff --git a/po/weechat.pot b/po/weechat.pot index 5ba9ea33c..73103faf0 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-08-24 10:06+0200\n" +"POT-Creation-Date: 2015-08-24 13:25+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -8585,6 +8585,9 @@ msgid "" "expire)" msgstr "" +msgid "timeout (in seconds) for download of scripts and list of scripts" +msgstr "" + msgid "" "local cache directory for scripts; \"%h\" at beginning of string is replaced " "by WeeChat home (\"~/.weechat\" by default) (note: content is evaluated, " diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c index 032ec223f..753be0531 100644 --- a/src/plugins/script/script-action.c +++ b/src/plugins/script/script-action.c @@ -648,9 +648,12 @@ script_action_install (int quiet) ptr_script_to_install->name_with_extension); } weechat_hashtable_set (options, "file_out", filename); - weechat_hook_process_hashtable (url, options, 30000, - &script_action_install_process_cb, - (quiet) ? (void *)1 : (void *)0); + weechat_hook_process_hashtable ( + url, + options, + weechat_config_integer (script_config_scripts_download_timeout) * 1000, + &script_action_install_process_cb, + (quiet) ? (void *)1 : (void *)0); free (url); } weechat_hashtable_free (options); @@ -1067,9 +1070,12 @@ script_action_show (const char *name, int quiet) if (url) { weechat_hashtable_set (options, "file_out", filename); - weechat_hook_process_hashtable (url, options, 30000, - &script_action_show_source_process_cb, - NULL); + weechat_hook_process_hashtable ( + url, + options, + weechat_config_integer (script_config_scripts_download_timeout) * 1000, + &script_action_show_source_process_cb, + NULL); free (url); } weechat_hashtable_free (options); diff --git a/src/plugins/script/script-config.c b/src/plugins/script/script-config.c index b5333fe54..69aec5d8f 100644 --- a/src/plugins/script/script-config.c +++ b/src/plugins/script/script-config.c @@ -82,6 +82,7 @@ struct t_config_option *script_config_color_text_version_selected; struct t_config_option *script_config_scripts_autoload; struct t_config_option *script_config_scripts_cache_expire; +struct t_config_option *script_config_scripts_download_timeout; struct t_config_option *script_config_scripts_path; struct t_config_option *script_config_scripts_hold; struct t_config_option *script_config_scripts_url; @@ -656,6 +657,12 @@ script_config_init () "0 = always expire)"), NULL, -1, 525600, "1440", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + script_config_scripts_download_timeout = weechat_config_new_option ( + script_config_file, ptr_section, + "download_timeout", "integer", + N_("timeout (in seconds) for download of scripts and list of scripts"), + NULL, 1, 3600, "30", NULL, 0, NULL, NULL, + NULL, NULL, NULL, NULL); script_config_scripts_path = weechat_config_new_option ( script_config_file, ptr_section, "path", "string", diff --git a/src/plugins/script/script-config.h b/src/plugins/script/script-config.h index 6f488bda5..2917e7da4 100644 --- a/src/plugins/script/script-config.h +++ b/src/plugins/script/script-config.h @@ -62,6 +62,7 @@ extern struct t_config_option *script_config_color_text_version_selected; extern struct t_config_option *script_config_scripts_autoload; extern struct t_config_option *script_config_scripts_cache_expire; +extern struct t_config_option *script_config_scripts_download_timeout; extern struct t_config_option *script_config_scripts_path; extern struct t_config_option *script_config_scripts_hold; extern struct t_config_option *script_config_scripts_url; diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index 23db271b2..bef5fad17 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -1472,9 +1472,12 @@ script_repo_file_update (int quiet) SCRIPT_PLUGIN_NAME); } weechat_hashtable_set (options, "file_out", filename); - weechat_hook_process_hashtable (url, options, 30000, - &script_repo_file_update_process_cb, - (quiet) ? (void *)1 : (void *)0); + weechat_hook_process_hashtable ( + url, + options, + weechat_config_integer (script_config_scripts_download_timeout) * 1000, + &script_repo_file_update_process_cb, + (quiet) ? (void *)1 : (void *)0); free (url); } weechat_hashtable_free (options);