0
0
mirror of https://github.com/irssi/irssi.git synced 2025-06-30 22:18:06 -04:00

Don't fail the remote redirections either until MAX_FAILURE_COUNT

redirections have gone without reply to our redirection. This is because
the timeout itself may fail if lag to the server is too high.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2177 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-01 20:36:44 +00:00 committed by cras
parent 5524f89d71
commit 85d0060426

View File

@ -411,6 +411,10 @@ static void redirect_abort(IRC_SERVER_REC *server, REDIRECT_REC *rec)
server_redirect_destroy(rec); server_redirect_destroy(rec);
} }
#define REDIRECT_IS_TIMEOUTED(rec) \
((now-(rec)->created) > (rec)->cmd->timeout)
static REDIRECT_REC *redirect_find(IRC_SERVER_REC *server, const char *event, static REDIRECT_REC *redirect_find(IRC_SERVER_REC *server, const char *event,
const char *args, const char **signal, const char *args, const char **signal,
int *match) int *match)
@ -442,13 +446,18 @@ static REDIRECT_REC *redirect_find(IRC_SERVER_REC *server, const char *event,
if (rec == redirect) if (rec == redirect)
break; break;
next = tmp->next; next = tmp->next;
if (rec->destroyed || if (rec->destroyed) {
(rec->remote && (now-rec->created) > rec->cmd->timeout) || /* redirection is finished, destroy it */
(!rec->remote && redirect != NULL)) { redirect_abort(server, rec);
if (rec->aborted || rec->remote || } else if (redirect != NULL) {
++rec->failures >= MAX_FAILURE_COUNT) /* check if redirection failed */
redirect_abort(server, rec); if (rec->aborted ||
++rec->failures >= MAX_FAILURE_COUNT) {
/* enough failures, abort it now */
if (!rec->remote || REDIRECT_IS_TIMEOUTED(rec))
redirect_abort(server, rec);
}
} }
} }