]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream: allocate without queuing when retrying
authorWilly Tarreau <w@1wt.eu>
Tue, 7 May 2024 15:54:03 +0000 (17:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 May 2024 15:18:13 +0000 (17:18 +0200)
Now when trying to allocate the work buffer, we can check if we've been
notified of availability via the buf_wait callback, in which case we
should not consult the queue, or if we're doing a first allocation and
check the queue.

src/stream.c

index 234cc9c3ec105bbda2420490dd778927f82f6335..ed5c268b855c97bf94c280561c17f2aa2ecaf0e0 100644 (file)
@@ -749,7 +749,7 @@ void stream_free(struct stream *s)
  */
 static int stream_alloc_work_buffer(struct stream *s)
 {
-       if (b_alloc(&s->res.buf, DB_CHANNEL)) {
+       if (b_alloc(&s->res.buf, DB_CHANNEL | ((s->flags & SF_MAYALLOC) ? DB_F_NOQUEUE : 0))) {
                s->flags &= ~SF_MAYALLOC;
                return 1;
        }