diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index 7bab7ffd0..a687b2ac6 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -385,9 +385,17 @@ static inline void si_update(struct stream_interface *si) si->ops->update(si); } -/* Calls chk_rcv on the connection using the data layer */ +/* This is to be used after making some room available in a channel. It will + * clear SI_FL_WAIT_ROOM, then if SI_FL_WANT_PUT is set, will calls ->chk_rcv() + * to enable receipt of new data. + */ static inline void si_chk_rcv(struct stream_interface *si) { + si->flags &= ~SI_FL_WAIT_ROOM; + + if (!(si->flags & SI_FL_WANT_PUT)) + return; + si->ops->chk_rcv(si); } diff --git a/src/stream_interface.c b/src/stream_interface.c index b0ccf9e97..ad9ff9efd 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -257,7 +257,6 @@ static void stream_int_chk_rcv(struct stream_interface *si) } else { /* (re)start reading */ - si->flags &= ~SI_FL_WAIT_ROOM; tasklet_wakeup(si->wait_event.task); if (!(si->flags & SI_FL_DONT_WAKE)) task_wakeup(si_task(si), TASK_WOKEN_IO); @@ -970,7 +969,6 @@ static void stream_int_chk_rcv_conn(struct stream_interface *si) } else { /* (re)start reading */ - si->flags &= ~SI_FL_WAIT_ROOM; tasklet_wakeup(si->wait_event.task); } } @@ -1502,9 +1500,6 @@ static void stream_int_chk_rcv_applet(struct stream_interface *si) if (unlikely(si->state != SI_ST_EST || (ic->flags & (CF_SHUTR|CF_DONT_READ)))) return; - /* here we only wake the applet up if it was waiting for some room */ - if (!(si->flags & SI_FL_WAIT_ROOM)) - return; if (channel_may_recv(ic) && !ic->pipe) { /* (re)start reading */