]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: queue: store a pointer to the queue into the pendconn
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Jun 2021 14:33:52 +0000 (16:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jun 2021 08:52:31 +0000 (10:52 +0200)
By following the queue pointer in the pendconn it will now be possible
to always retrieve the elements (index, srv, px, etc).

include/haproxy/queue-t.h
src/queue.c

index cb317db3133a5753fa99ab2175635b9241691e5e..a2e321c1ca3a4e7c02768dfff89b98da82bf3c28 100644 (file)
 struct proxy;
 struct server;
 struct stream;
+struct queue;
 
 struct pendconn {
        int            strm_flags; /* stream flags */
        unsigned int   queue_idx;  /* value of proxy/server queue_idx at time of enqueue */
        struct stream *strm;
+       struct queue  *queue;      /* the queue the entry is queued into */
        struct proxy  *px;
        struct server *srv;        /* the server we are waiting for, may be NULL if don't care */
        struct server *target;     /* the server that was assigned, = srv except if srv==NULL */
index f0dcd117a15062d0ec41adef067a226e6dfa6b39..f84ec945c57348f4de3107bffdf1895a830e0560 100644 (file)
@@ -434,6 +434,7 @@ struct pendconn *pendconn_add(struct stream *strm)
                max_ptr = &px->be_counters.nbpend_max;
        }
 
+       p->queue = q;
        p->queue_idx  = _HA_ATOMIC_LOAD(&q->idx) - 1; // for logging only
        new_max = _HA_ATOMIC_ADD_FETCH(&q->length, 1);
        old_max = _HA_ATOMIC_LOAD(max_ptr);