MINOR: queue: update the stream's pend_pos before queuing it
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Jun 2021 08:33:47 +0000 (10:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Jun 2021 16:21:18 +0000 (18:21 +0200)
commit901972e261da6747aff7ea2ebbd0f35aec6a8a08
tree427b80ef4e529ddc5706118f55a9c339156ce6fb
parent0ffad2d76c33ca31e897d64e16ab00e6b1825ce3
MINOR: queue: update the stream's pend_pos before queuing it

Since commit c7eedf7a5 ("MINOR: queue: reduce the locked area in
pendconn_add()") the stream's pend_pos is set out of the lock, after
the pendconn is queued. While this entry is only manipulated by the
stream itself and there is no bug caused by this right now, it's a
bit dangerous because another thread could decide to look at this
field during dequeuing and could randomly see something else. Also
in case of crashes, memory inspection wouldn't be as trustable.
Let's assign the pendconn before it can be found in the queue.
src/queue.c