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.
This commit is contained in:
Willy Tarreau 2024-05-07 17:54:03 +02:00
parent f552f79ba5
commit b5714b45e8

View File

@ -749,7 +749,7 @@ void stream_free(struct stream *s)
*/ */
static int stream_alloc_work_buffer(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; s->flags &= ~SF_MAYALLOC;
return 1; return 1;
} }