sc_ep_set(cs, SE_FL_RX_WAIT_EP);
}
-/* Tell a stream connector the input channel is OK with it sending it some data */
-static inline void cs_rx_chan_rdy(struct stconn *cs)
+/* The application layer informs a stream connector that it's willing to
+ * receive data from the endpoint.
+ */
+static inline void sc_will_read(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_RXBLK_CHAN);
}
-/* Tell a stream connector the input channel is not OK with it sending it some data */
-static inline void cs_rx_chan_blk(struct stconn *cs)
+/* The application layer informs a stream connector that it will not receive
+ * data from the endpoint (e.g. need to flush, bw limitations etc). Usually
+ * it corresponds to the channel's CF_DONT_READ flag.
+ */
+static inline void sc_wont_read(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RXBLK_CHAN);
}
/* Read not closed, update FD status and timeout for reads */
if (ic->flags & CF_DONT_READ)
- cs_rx_chan_blk(cs);
+ sc_wont_read(cs);
else
- cs_rx_chan_rdy(cs);
+ sc_will_read(cs);
if (!channel_is_empty(ic) || !channel_may_recv(ic)) {
/* stop reading, imposed by channel's policy or contents */
}
if (oc->flags & CF_DONT_READ)
- cs_rx_chan_blk(cso);
+ sc_wont_read(cso);
else
- cs_rx_chan_rdy(cso);
+ sc_will_read(cso);
/* Notify the other side when we've injected data into the IC that
* needs to be forwarded. We can do fast-forwarding as soon as there
}
if (!(ic->flags & CF_DONT_READ))
- cs_rx_chan_rdy(cs);
+ sc_will_read(cs);
cs_chk_rcv(cs);
cs_chk_rcv(cso);
if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) {
/* we're stopped by the channel's policy */
- cs_rx_chan_blk(cs);
+ sc_wont_read(cs);
break;
}
*/
if (ic->flags & CF_STREAMER) {
/* we're stopped by the channel's policy */
- cs_rx_chan_blk(cs);
+ sc_wont_read(cs);
break;
}
*/
if (ret >= global.tune.recv_enough) {
/* we're stopped by the channel's policy */
- cs_rx_chan_blk(cs);
+ sc_wont_read(cs);
break;
}
}