From: Willy Tarreau Date: Fri, 13 Jun 2008 19:48:18 +0000 (+0200) Subject: [BUG] log: reported queue position was offed-by-one X-Git-Tag: v1.3.16-rc1~259 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a63abd84f6b662e7daf55e6e3bd680bcab93239;p=thirdparty%2Fhaproxy.git [BUG] log: reported queue position was offed-by-one The reported queue position in the logs was 0 for the first pending request in the queue, which is wrong because it means that one request will have to be completed before the queued one may execute. It caused the undesired side effect that 0/0 was reported when either 0 or 1 request was pending in the queue. Thus, we have to increment the queue size before reporting the value. --- diff --git a/src/queue.c b/src/queue.c index d29170a3b5..4d383f03f9 100644 --- a/src/queue.c +++ b/src/queue.c @@ -135,14 +135,14 @@ struct pendconn *pendconn_add(struct session *sess) p->srv = sess->srv; if (sess->srv) { LIST_ADDQ(&sess->srv->pendconns, &p->list); - sess->logs.srv_queue_size += sess->srv->nbpend; sess->srv->nbpend++; + sess->logs.srv_queue_size += sess->srv->nbpend; if (sess->srv->nbpend > sess->srv->nbpend_max) sess->srv->nbpend_max = sess->srv->nbpend; } else { LIST_ADDQ(&sess->be->pendconns, &p->list); - sess->logs.prx_queue_size += sess->be->nbpend; sess->be->nbpend++; + sess->logs.prx_queue_size += sess->be->nbpend; if (sess->be->nbpend > sess->be->nbpend_max) sess->be->nbpend_max = sess->be->nbpend; }