mirror of
https://github.com/irssi/irssi.git
synced 2024-10-27 05:20:20 -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:
parent
5524f89d71
commit
85d0060426
@ -411,6 +411,10 @@ static void redirect_abort(IRC_SERVER_REC *server, REDIRECT_REC *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,
|
||||
const char *args, const char **signal,
|
||||
int *match)
|
||||
@ -442,13 +446,18 @@ static REDIRECT_REC *redirect_find(IRC_SERVER_REC *server, const char *event,
|
||||
if (rec == redirect)
|
||||
break;
|
||||
|
||||
next = tmp->next;
|
||||
if (rec->destroyed ||
|
||||
(rec->remote && (now-rec->created) > rec->cmd->timeout) ||
|
||||
(!rec->remote && redirect != NULL)) {
|
||||
if (rec->aborted || rec->remote ||
|
||||
++rec->failures >= MAX_FAILURE_COUNT)
|
||||
redirect_abort(server, rec);
|
||||
next = tmp->next;
|
||||
if (rec->destroyed) {
|
||||
/* redirection is finished, destroy it */
|
||||
redirect_abort(server, rec);
|
||||
} else if (redirect != NULL) {
|
||||
/* check if redirection failed */
|
||||
if (rec->aborted ||
|
||||
++rec->failures >= MAX_FAILURE_COUNT) {
|
||||
/* enough failures, abort it now */
|
||||
if (!rec->remote || REDIRECT_IS_TIMEOUTED(rec))
|
||||
redirect_abort(server, rec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user