1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

script: add option script.scripts.download_timeout

This commit is contained in:
Sébastien Helleu
2015-08-24 13:26:59 +02:00
parent 00b60be4b7
commit c35c941298
23 changed files with 126 additions and 22 deletions
+12 -6
View File
@@ -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);
+7
View File
@@ -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",
+1
View File
@@ -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;
+6 -3
View File
@@ -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);