mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-18 10:56:42 +02:00
MINOR: queue: add a pointer to the server and the proxy in the queue
A queue is specific to a server or a proxy, so we don't need to place this distinction inside all pendconns, it can be in the queue itself. This commit adds the relevant fields "px" and "sv" into the struct queue, and initializes them accordingly.
This commit is contained in:
@@ -109,11 +109,18 @@ static inline int queue_limit_offset(int offset)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static inline void queue_init(struct queue *queue)
|
||||
/* initialize the queue <queue> for proxy <px> and server <sv>. A server's
|
||||
* always has both a valid proxy and a valid server. A proxy's queue only
|
||||
* has a valid proxy and NULL for the server queue. This is how they're
|
||||
* distinguished during operations.
|
||||
*/
|
||||
static inline void queue_init(struct queue *queue, struct proxy *px, struct server *sv)
|
||||
{
|
||||
queue->head = EB_ROOT;
|
||||
queue->length = 0;
|
||||
queue->idx = 0;
|
||||
queue->px = px;
|
||||
queue->sv = sv;
|
||||
HA_SPIN_INIT(&queue->lock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user