From: Willy Tarreau Date: Tue, 7 May 2024 15:54:03 +0000 (+0200) Subject: MEDIUM: stream: allocate without queuing when retrying X-Git-Tag: v3.0-dev11~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5714b45e8da2edecad1a2c5c8d5551d668ef022;p=thirdparty%2Fhaproxy.git 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. --- 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; }