*/
#define SF_DIRECT 0x00000001 /* connection made on the server matching the client cookie */
#define SF_ASSIGNED 0x00000002 /* no need to assign a server to this stream */
-/* unused: 0x00000004 */
+#define SF_MAYALLOC 0x00000004 /* we were notified that a work buffer might be available now */
#define SF_BE_ASSIGNED 0x00000008 /* a backend was assigned. Conns are accounted. */
#define SF_FORCE_PRST 0x00000010 /* force persistence here, even if server is down */
_e(SF_ERR_MASK, SF_ERR_DOWN, _e(SF_ERR_MASK, SF_ERR_KILLED,
_e(SF_ERR_MASK, SF_ERR_UP, _e(SF_ERR_MASK, SF_ERR_CHK_PORT))))))))))));
- _(SF_DIRECT, _(SF_ASSIGNED, _(SF_BE_ASSIGNED, _(SF_FORCE_PRST,
+ _(SF_DIRECT, _(SF_ASSIGNED, _(SF_MAYALLOC, _(SF_BE_ASSIGNED, _(SF_FORCE_PRST,
_(SF_MONITOR, _(SF_CURR_SESS, _(SF_CONN_EXP, _(SF_REDISP,
- _(SF_IGNORE, _(SF_REDIRECTABLE, _(SF_HTX)))))))))));
+ _(SF_IGNORE, _(SF_REDIRECTABLE, _(SF_HTX))))))))))));
/* epilogue */
_(~0U);
if (!s->res.buf.size && !sc_ep_have_ff_data(s->scf) && s->scb->flags & SC_FL_NEED_BUFF)
sc_have_buff(s->scb);
+ s->flags |= SF_MAYALLOC;
task_wakeup(s->task, TASK_WOKEN_RES);
return 1;
*/
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;
return 1;
+ }
b_requeue(DB_CHANNEL, &s->buffer_wait);
return 0;