SHOW_FLAG(f, SE_FL_RXBLK_BUFF);
SHOW_FLAG(f, SE_FL_RXBLK_ROOM);
SHOW_FLAG(f, SE_FL_APPLET_NEED_CONN);
- SHOW_FLAG(f, SE_FL_RX_WAIT_EP);
+ SHOW_FLAG(f, SE_FL_HAVE_NO_DATA);
SHOW_FLAG(f, SE_FL_WANT_GET);
SHOW_FLAG(f, SE_FL_WAIT_DATA);
SHOW_FLAG(f, SE_FL_KILL_CONN);
*/
static inline void applet_have_more_data(struct appctx *appctx)
{
- se_fl_clr(appctx->sedesc, SE_FL_RX_WAIT_EP);
+ se_fl_clr(appctx->sedesc, SE_FL_HAVE_NO_DATA);
}
/* The applet announces it doesn't have more data for the stream's input
*/
static inline void applet_have_no_more_data(struct appctx *appctx)
{
- se_fl_set(appctx->sedesc, SE_FL_RX_WAIT_EP);
+ se_fl_set(appctx->sedesc, SE_FL_HAVE_NO_DATA);
}
/* writes chunk <chunk> into the input channel of the stream attached to this
SE_FL_KILL_CONN = 0x00400000, /* must kill the connection when the CS closes */
SE_FL_WAIT_DATA = 0x00800000, /* CS waits for more outgoing data to send */
SE_FL_WANT_GET = 0x01000000, /* CS would like to get some data from the buffer */
- SE_FL_RX_WAIT_EP = 0x02000000, /* CS waits for more data from the end point */
+ SE_FL_HAVE_NO_DATA = 0x02000000, /* the endpoint has no more data to deliver to the stream */
SE_FL_RXBLK_CHAN = 0x04000000, /* the channel doesn't want the CS to introduce data */
SE_FL_RXBLK_BUFF = 0x08000000, /* CS waits for a buffer allocation to complete */
SE_FL_RXBLK_ROOM = 0x10000000, /* CS waits for more buffer room to store incoming data */
return !!sc_ep_test(cs, SE_FL_RXBLK_ROOM);
}
-/* Returns non-zero if the stream connector's endpoint is ready to receive */
-static inline int cs_rx_endp_ready(const struct stconn *cs)
-{
- return !sc_ep_test(cs, SE_FL_RX_WAIT_EP);
-}
-
/* The stream endpoint announces it has more data to deliver to the stream's
* input buffer.
*/
static inline void se_have_more_data(struct sedesc *se)
{
- se_fl_clr(se, SE_FL_RX_WAIT_EP);
+ se_fl_clr(se, SE_FL_HAVE_NO_DATA);
}
/* The stream endpoint announces it doesn't have more data for the stream's
*/
static inline void se_have_no_more_data(struct sedesc *se)
{
- se_fl_set(se, SE_FL_RX_WAIT_EP);
+ se_fl_set(se, SE_FL_HAVE_NO_DATA);
}
/* The application layer informs a stream connector that it's willing to
/* The stream connector failed to get an input buffer and is waiting for it.
* It indicates a willingness to deliver data to the buffer that will have to
- * be retried, as such, callers will often automatically clear RXBLK_ENDP to be
+ * be retried. As such, callers will often automatically clear SE_FL_HAVE_NO_DATA
* called again as soon as RXBLK_BUFF is cleared.
*/
static inline void sc_need_buff(struct stconn *cs)
/* The stream connector announces it failed to put data into the input buffer
* by lack of room. Since it indicates a willingness to deliver data to the
* buffer that will have to be retried. Usually the caller will also clear
- * RXBLK_ENDP to be called again as soon as RXBLK_ROOM is cleared.
+ * SE_FL_HAVE_NO_DATA to be called again as soon as RXBLK_ROOM is cleared.
*/
static inline void sc_need_room(struct stconn *cs)
{
* failure, non-zero otherwise. If no buffer is available, the requester,
* represented by the <wait> pointer, will be added in the list of objects
* waiting for an available buffer, and SE_FL_RXBLK_BUFF will be set on the
- * stream connector and SE_FL_RX_WAIT_EP cleared. The requester will be responsible
+ * stream connector and SE_FL_HAVE_NO_DATA cleared. The requester will be responsible
* for calling this function to try again once woken up.
*/
static inline int cs_alloc_ibuf(struct stconn *cs, struct buffer_wait *wait)
if (sc_ep_test(sc, SE_FL_APPLET_NEED_CONN))
return 0;
- return cs_rx_endp_ready(sc) && !cs_rx_blocked(sc);
+ if (sc_ep_test(sc, SE_FL_HAVE_NO_DATA))
+ return 0;
+
+ return !cs_rx_blocked(sc);
}
/* This is to be used after making some room available in a channel. It will
if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST))
return;
- sc_ep_set(cs, SE_FL_RX_WAIT_EP);
+ sc_ep_set(cs, SE_FL_HAVE_NO_DATA);
if (likely(cs->app_ops->chk_rcv))
cs->app_ops->chk_rcv(cs);
}
/* If the applet wants to write and the channel is closed, it's a
* broken pipe and it must be reported.
*/
- if (!sc_ep_test(cs, SE_FL_RX_WAIT_EP) && (ic->flags & CF_SHUTR))
+ if (!sc_ep_test(cs, SE_FL_HAVE_NO_DATA) && (ic->flags & CF_SHUTR))
sc_ep_set(cs, SE_FL_ERROR);
/* automatically mark the applet having data available if it reported