From b5714b45e8da2edecad1a2c5c8d5551d668ef022 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 7 May 2024 17:54:03 +0200 Subject: [PATCH] MEDIUM: stream: allocate without queuing when retrying 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index 234cc9c3ec..ed5c268b85 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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; } -- 2.47.3