mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Allow replies to redirections come in a bit different order than expected -
default is if 3 replies to other redirections are received, abort the expected one. This is because some IRC bouncers reply to some of the commands (PING) themself immediately. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2036 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
15933dcea0
commit
7545f463bd
@ -28,6 +28,11 @@
|
||||
|
||||
#define DEFAULT_REDIRECT_TIMEOUT 60
|
||||
|
||||
/* Allow 2 non-expected redirections to come before the expected one
|
||||
before aborting it. Some IRC bouncers/proxies reply to eg. PINGs
|
||||
immediately. */
|
||||
#define MAX_FAILURE_COUNT 2
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
int refcount;
|
||||
@ -40,6 +45,7 @@ typedef struct {
|
||||
struct _REDIRECT_REC {
|
||||
REDIRECT_CMD_REC *cmd;
|
||||
time_t created;
|
||||
int failures;
|
||||
int destroyed;
|
||||
|
||||
char *arg;
|
||||
@ -411,9 +417,11 @@ static REDIRECT_REC *redirect_find(IRC_SERVER_REC *server, const char *event,
|
||||
next = tmp->next;
|
||||
if (rec->destroyed ||
|
||||
(rec->remote && (now-rec->created) > rec->cmd->timeout) ||
|
||||
(!rec->remote && redirect != NULL))
|
||||
(!rec->remote && redirect != NULL)) {
|
||||
if (rec->remote || ++rec->failures >= MAX_FAILURE_COUNT)
|
||||
redirect_abort(server, rec);
|
||||
}
|
||||
}
|
||||
|
||||
return redirect;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user