diff --git a/src/lb_map.c b/src/lb_map.c index df7af7f33..be61b77e8 100644 --- a/src/lb_map.c +++ b/src/lb_map.c @@ -99,9 +99,8 @@ void recalc_server_map(struct proxy *px) int max = 0; best = NULL; for (cur = px->srv; cur; cur = cur->next) { - if (cur->eweight && - (cur->flags & SRV_F_BACKUP) == flag && - (cur->state == SRV_ST_STARTING || cur->state == SRV_ST_RUNNING)) { + if ((cur->flags & SRV_F_BACKUP) == flag && + srv_is_usable(cur)) { int v; /* If we are forced to return only one server, we don't want to diff --git a/src/queue.c b/src/queue.c index 8b4d9ed3a..74fa65921 100644 --- a/src/queue.c +++ b/src/queue.c @@ -204,7 +204,7 @@ int pendconn_grab_from_px(struct server *s) { int xferred; - if (!s->eweight) + if (!srv_is_usable(s)) return 0; for (xferred = 0; !s->maxconn || xferred < srv_dynamic_maxconn(s); xferred++) { diff --git a/src/server.c b/src/server.c index 98ac2cd10..857c8aaf6 100644 --- a/src/server.c +++ b/src/server.c @@ -637,7 +637,7 @@ void server_recalc_eweight(struct server *sv) /* now propagate the status change to any LB algorithms */ if (px->lbprm.update_server_eweight) px->lbprm.update_server_eweight(sv); - else if (sv->eweight) { + else if (srv_is_usable(sv)) { if (px->lbprm.set_server_status_up) px->lbprm.set_server_status_up(sv); }