BUG/MINOR: backend: properly handle redispatch 0

According to the documentation, "option redispatch 0" is expected to
disable redispatch just like "no option redispatch", but due to the
fact that it keeps PR_O_REDISP set, it doesn't actually work. Let's
make sure value 0 is properly handled and drops PR_O_REDISP. This can
be backported to all versions since it seems it has been broken since
its introduction in 1.6 with commit 726ab7145c ("MEDIUM: backend: Allow
redispatch on retry intervals").

As a workaround, "no option redispatch" does work though.
This commit is contained in:
Willy Tarreau 2024-04-02 15:15:32 +02:00
parent 4c361a9d8a
commit e9b774f4b3

View File

@ -2050,8 +2050,10 @@ stats_error_parsing:
case KWM_STD:
curproxy->options |= PR_O_REDISP;
curproxy->redispatch_after = -1;
if(*args[2]) {
if (*args[2]) {
curproxy->redispatch_after = atol(args[2]);
if (!curproxy->redispatch_after)
curproxy->options &= ~PR_O_REDISP;
}
break;
case KWM_NO: