diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index 33b908b89..8e89cc645 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -317,14 +317,19 @@ static inline void cs_rx_endp_done(struct stconn *cs) 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); } diff --git a/src/conn_stream.c b/src/conn_stream.c index caf33e438..b898dd9f7 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -1015,9 +1015,9 @@ void cs_update_rx(struct stconn *cs) /* 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 */ @@ -1135,9 +1135,9 @@ static void cs_notify(struct stconn *cs) } 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 @@ -1173,7 +1173,7 @@ static void cs_notify(struct stconn *cs) } if (!(ic->flags & CF_DONT_READ)) - cs_rx_chan_rdy(cs); + sc_will_read(cs); cs_chk_rcv(cs); cs_chk_rcv(cso); @@ -1489,7 +1489,7 @@ static int sc_conn_recv(struct stconn *cs) 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; } @@ -1504,7 +1504,7 @@ static int sc_conn_recv(struct stconn *cs) */ if (ic->flags & CF_STREAMER) { /* we're stopped by the channel's policy */ - cs_rx_chan_blk(cs); + sc_wont_read(cs); break; } @@ -1513,7 +1513,7 @@ static int sc_conn_recv(struct stconn *cs) */ if (ret >= global.tune.recv_enough) { /* we're stopped by the channel's policy */ - cs_rx_chan_blk(cs); + sc_wont_read(cs); break; } } diff --git a/src/http_client.c b/src/http_client.c index d0b2a58a2..da774e759 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -911,7 +911,7 @@ static void httpclient_applet_io_handler(struct appctx *appctx) process_data: - cs_rx_chan_rdy(cs); + sc_will_read(cs); return; more: