mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MINOR: backend: nbsrv() should return 0 if backend is disabled
According to nbsrv() documentation this fetcher should return "an integer value corresponding to the number of usable servers". In case backend is disabled none of servers is usable, so I believe fetcher should return 0. This patch should be backported to 1.7, 1.6, 1.5.
This commit is contained in:
parent
ef934603c0
commit
57b877147d
@ -1607,7 +1607,9 @@ smp_fetch_nbsrv(const struct arg *args, struct sample *smp, const char *kw, void
|
||||
smp->data.type = SMP_T_SINT;
|
||||
px = args->data.prx;
|
||||
|
||||
if (px->srv_act)
|
||||
if (px->state == PR_STSTOPPED)
|
||||
smp->data.u.sint = 0;
|
||||
else if (px->srv_act)
|
||||
smp->data.u.sint = px->srv_act;
|
||||
else if (px->lbprm.fbck)
|
||||
smp->data.u.sint = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user