mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 10:43:13 +02:00
core: set "error" field of "output" hashtable in hook_url in case of transfer timeout
This commit is contained in:
@@ -598,7 +598,7 @@ hook_process_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
if (weechat_debug_core >= 1)
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("End of command '%s', timeout reached (%.1fs)"),
|
||||
_("End of command '%s', timeout reached (%.3fs)"),
|
||||
HOOK_PROCESS(hook_process, command),
|
||||
((float)HOOK_PROCESS(hook_process, timeout)) / 1000);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ hook_url_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
{
|
||||
struct t_hook *hook;
|
||||
const char *ptr_error;
|
||||
char str_error[1024];
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
@@ -178,12 +179,19 @@ hook_url_timer_cb (const void *pointer, void *data, int remaining_calls)
|
||||
|
||||
if (remaining_calls == 0)
|
||||
{
|
||||
if (!hashtable_has_key (HOOK_URL(hook, output), "error"))
|
||||
{
|
||||
snprintf (str_error, sizeof (str_error),
|
||||
"transfer timeout reached (%.3fs)",
|
||||
((float)HOOK_URL(hook, timeout)) / 1000);
|
||||
hashtable_set (HOOK_URL(hook, output), "error", str_error);
|
||||
}
|
||||
hook_url_run_callback (hook);
|
||||
if (weechat_debug_core >= 1)
|
||||
{
|
||||
gui_chat_printf (
|
||||
NULL,
|
||||
_("End of URL transfer '%s', timeout reached (%.1fs)"),
|
||||
_("End of URL transfer '%s', timeout reached (%.3fs)"),
|
||||
HOOK_URL(hook, url),
|
||||
((float)HOOK_URL(hook, timeout)) / 1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user