MEDIUM: stream: always call si_cs_recv() after a failed buffer allocation

If a buffer allocation failed, we have SI_FL_WAIT_ROOM set and c_size(buf)
being zero. It's the only moment where we have a new opportunity to try to
allocate this buffer. However we don't want to waste our time trying this
if both are non-null since it indicates missing room without any changed
condition.
This commit is contained in:
Willy Tarreau 2018-10-25 10:28:27 +02:00
parent 581abd3f99
commit 18e066c2e7

View File

@ -1676,7 +1676,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state)
co_data(si_oc(si_f)))
si_cs_send(cs);
if (!(si_f->wait_event.wait_reason & SUB_CAN_RECV) &&
!(si_f->flags & SI_FL_WAIT_ROOM))
(!(si_f->flags & SI_FL_WAIT_ROOM) || !c_size(req)))
si_cs_recv(cs);
}
cs = objt_cs(si_b->end);
@ -1685,7 +1685,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state)
co_data(si_oc(si_b)))
si_cs_send(cs);
if (!(si_b->wait_event.wait_reason & SUB_CAN_RECV) &&
!(si_b->flags & SI_FL_WAIT_ROOM))
(!(si_b->flags & SI_FL_WAIT_ROOM) || !c_size(res)))
si_cs_recv(cs);
}
redo: