MEDIUM: stream-int/conn-stream: Move blocking flags from SI to CS
Remaining flags and associated functions are move in the conn-stream
scope. These flags are added on the endpoint and not the conn-stream
itself. This way it will be possible to get them from the mux or the
applet. The functions to get or set these flags are renamed accordingly with
the "cs_" prefix and updated to manipualte a conn-stream instead of a
stream-interface.
diff --git a/addons/promex/service-prometheus.c b/addons/promex/service-prometheus.c
index 8560409..078b442 100644
--- a/addons/promex/service-prometheus.c
+++ b/addons/promex/service-prometheus.c
@@ -1303,7 +1303,7 @@
return 1;
full:
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
error:
/* unrecoverable error */
@@ -1448,7 +1448,7 @@
return 1;
full:
htx_reset(htx);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -1478,7 +1478,7 @@
/* Check if the input buffer is available. */
if (!b_size(&res->buf)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
@@ -1519,7 +1519,7 @@
*/
if (htx_is_empty(res_htx)) {
if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
channel_add_input(res, 1);
diff --git a/dev/flags/flags.c b/dev/flags/flags.c
index 4081082..5198fec 100644
--- a/dev/flags/flags.c
+++ b/dev/flags/flags.c
@@ -187,6 +187,15 @@
printf("0\n");
return;
}
+
+ SHOW_FLAG(f, CS_EP_RXBLK_CHAN);
+ SHOW_FLAG(f, CS_EP_RXBLK_BUFF);
+ SHOW_FLAG(f, CS_EP_RXBLK_ROOM);
+ SHOW_FLAG(f, CS_EP_RXBLK_SHUT);
+ SHOW_FLAG(f, CS_EP_RXBLK_CONN);
+ SHOW_FLAG(f, CS_EP_RX_WAIT_EP);
+ SHOW_FLAG(f, CS_EP_WANT_GET);
+ SHOW_FLAG(f, CS_EP_WAIT_DATA);
SHOW_FLAG(f, CS_EP_KILL_CONN);
SHOW_FLAG(f, CS_EP_WAIT_FOR_HS);
SHOW_FLAG(f, CS_EP_WANT_ROOM);
@@ -267,15 +276,7 @@
return;
}
- SHOW_FLAG(f, SI_FL_WAIT_DATA);
SHOW_FLAG(f, SI_FL_ISBACK);
- SHOW_FLAG(f, SI_FL_WANT_GET);
- SHOW_FLAG(f, SI_FL_RXBLK_CHAN);
- SHOW_FLAG(f, SI_FL_RXBLK_BUFF);
- SHOW_FLAG(f, SI_FL_RXBLK_ROOM);
- SHOW_FLAG(f, SI_FL_RXBLK_SHUT);
- SHOW_FLAG(f, SI_FL_RXBLK_CONN);
- SHOW_FLAG(f, SI_FL_RX_WAIT_EP);
if (f) {
printf("EXTRA(0x%08x)", f);
diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h
index ef13a20..eaacaa4 100644
--- a/include/haproxy/conn_stream-t.h
+++ b/include/haproxy/conn_stream-t.h
@@ -67,13 +67,20 @@
CS_EP_RCV_MORE = 0x00080000, /* Endpoint may have more bytes to transfer */
CS_EP_WANT_ROOM = 0x00100000, /* More bytes to transfer, but not enough room */
- /* unused: 0x00200000 .. 0x00800000 */
-
/* following flags are supposed to be set by the app layer and read by
* the endpoint :
*/
- CS_EP_WAIT_FOR_HS = 0x01000000, /* This stream is waiting for handhskae */
- CS_EP_KILL_CONN = 0x02000000, /* must kill the connection when the CS closes */
+ CS_EP_WAIT_FOR_HS = 0x00200000, /* This stream is waiting for handhskae */
+ CS_EP_KILL_CONN = 0x00400000, /* must kill the connection when the CS closes */
+ CS_EP_WAIT_DATA = 0x00800000, /* CS waits for more outgoing data to send */
+ CS_EP_WANT_GET = 0x01000000, /* CS would like to get some data from the buffer */
+ CS_EP_RX_WAIT_EP = 0x02000000, /* CS waits for more data from the end point */
+ CS_EP_RXBLK_CHAN = 0x04000000, /* the channel doesn't want the CS to introduce data */
+ CS_EP_RXBLK_BUFF = 0x08000000, /* CS waits for a buffer allocation to complete */
+ CS_EP_RXBLK_ROOM = 0x10000000, /* CS waits for more buffer room to store incoming data */
+ CS_EP_RXBLK_SHUT = 0x20000000, /* input is now closed, nothing new will ever come */
+ CS_EP_RXBLK_CONN = 0x40000000, /* other side is not connected */
+ CS_EP_RXBLK_ANY = 0x7C000000, /* any of the RXBLK flags above */
};
/* conn_stream flags */
@@ -128,7 +135,7 @@
struct conn_stream;
-/* data_cb describes the data layer's recv and send callbacks which are called
+/* cs_data_cb describes the data layer's recv and send callbacks which are called
* when I/O activity was detected after the transport layer is ready. These
* callbacks are supposed to make use of the xprt_ops above to exchange data
* from/to buffers and pipes. The <wake> callback is used to report activity
diff --git a/include/haproxy/cs_utils.h b/include/haproxy/cs_utils.h
index 573be47..3bff380 100644
--- a/include/haproxy/cs_utils.h
+++ b/include/haproxy/cs_utils.h
@@ -145,8 +145,8 @@
* channel_alloc_buffer() for this so it abides by its rules. It returns 0 on
* 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 SI_FL_RXBLK_BUFF will be set on the
- * stream-int and SI_FL_RX_WAIT_EP cleared. The requester will be responsible
+ * waiting for an available buffer, and CS_EP_RXBLK_BUFF will be set on the
+ * stream-int and CS_EP_RX_WAIT_EP cleared. The requester will be responsible
* for calling this function to try again once woken up.
*/
static inline int cs_alloc_ibuf(struct conn_stream *cs, struct buffer_wait *wait)
@@ -155,7 +155,7 @@
ret = channel_alloc_buffer(cs_ic(cs), wait);
if (!ret)
- si_rx_buff_blk(cs->si);
+ cs_rx_buff_blk(cs);
return ret;
}
@@ -289,16 +289,16 @@
*/
static inline void cs_chk_rcv(struct conn_stream *cs)
{
- if (cs->si->flags & SI_FL_RXBLK_CONN && cs_state_in(cs_opposite(cs)->state, CS_SB_RDY|CS_SB_EST|CS_SB_DIS|CS_SB_CLO))
- si_rx_conn_rdy(cs->si);
+ if (cs->endp->flags & CS_EP_RXBLK_CONN && cs_state_in(cs_opposite(cs)->state, CS_SB_RDY|CS_SB_EST|CS_SB_DIS|CS_SB_CLO))
+ cs_rx_conn_rdy(cs);
- if (si_rx_blocked(cs->si) || !si_rx_endp_ready(cs->si))
+ if (cs_rx_blocked(cs) || !cs_rx_endp_ready(cs))
return;
if (!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST))
return;
- cs->si->flags |= SI_FL_RX_WAIT_EP;
+ cs->endp->flags |= CS_EP_RX_WAIT_EP;
cs->ops->chk_rcv(cs);
}
diff --git a/include/haproxy/stream_interface-t.h b/include/haproxy/stream_interface-t.h
index 7d5e50c..fc1a93d 100644
--- a/include/haproxy/stream_interface-t.h
+++ b/include/haproxy/stream_interface-t.h
@@ -32,18 +32,7 @@
enum {
SI_FL_NONE = 0x00000000, /* nothing */
/* unused: 0x00000001, 0x00000002 */
- SI_FL_WAIT_DATA = 0x00000008, /* stream-int waits for more outgoing data to send */
SI_FL_ISBACK = 0x00000010, /* 0 for front-side SI, 1 for back-side */
- /* unused: 0x00000200 */
- SI_FL_WANT_GET = 0x00004000, /* a stream-int would like to get some data from the buffer */
-
- SI_FL_RXBLK_CHAN = 0x00010000, /* the channel doesn't want the stream-int to introduce data */
- SI_FL_RXBLK_BUFF = 0x00020000, /* stream-int waits for a buffer allocation to complete */
- SI_FL_RXBLK_ROOM = 0x00040000, /* stream-int waits for more buffer room to store incoming data */
- SI_FL_RXBLK_SHUT = 0x00080000, /* input is now closed, nothing new will ever come */
- SI_FL_RXBLK_CONN = 0x00100000, /* other side is not connected */
- SI_FL_RXBLK_ANY = 0x001F0000, /* any of the RXBLK flags above */
- SI_FL_RX_WAIT_EP = 0x00200000, /* stream-int waits for more data from the end point */
};
/* A stream interface has 3 parts :
diff --git a/include/haproxy/stream_interface.h b/include/haproxy/stream_interface.h
index 3ffc3f4..5aef1a9 100644
--- a/include/haproxy/stream_interface.h
+++ b/include/haproxy/stream_interface.h
@@ -60,137 +60,137 @@
}
/* Returns non-zero if the stream interface's Rx path is blocked */
-static inline int si_rx_blocked(const struct stream_interface *si)
+static inline int cs_rx_blocked(const struct conn_stream *cs)
{
- return !!(si->flags & SI_FL_RXBLK_ANY);
+ return !!(cs->endp->flags & CS_EP_RXBLK_ANY);
}
-/* Returns non-zero if the stream interface's Rx path is blocked because of lack
+/* Returns non-zero if the conn-stream's Rx path is blocked because of lack
* of room in the input buffer.
*/
-static inline int si_rx_blocked_room(const struct stream_interface *si)
+static inline int cs_rx_blocked_room(const struct conn_stream *cs)
{
- return !!(si->flags & SI_FL_RXBLK_ROOM);
+ return !!(cs->endp->flags & CS_EP_RXBLK_ROOM);
}
-/* Returns non-zero if the stream interface's endpoint is ready to receive */
-static inline int si_rx_endp_ready(const struct stream_interface *si)
+/* Returns non-zero if the conn-stream's endpoint is ready to receive */
+static inline int cs_rx_endp_ready(const struct conn_stream *cs)
{
- return !(si->flags & SI_FL_RX_WAIT_EP);
+ return !(cs->endp->flags & CS_EP_RX_WAIT_EP);
}
-/* The stream interface announces it is ready to try to deliver more data to the input buffer */
-static inline void si_rx_endp_more(struct stream_interface *si)
+/* The conn-stream announces it is ready to try to deliver more data to the input buffer */
+static inline void cs_rx_endp_more(struct conn_stream *cs)
{
- si->flags &= ~SI_FL_RX_WAIT_EP;
+ cs->endp->flags &= ~CS_EP_RX_WAIT_EP;
}
-/* The stream interface announces it doesn't have more data for the input buffer */
-static inline void si_rx_endp_done(struct stream_interface *si)
+/* The conn-stream announces it doesn't have more data for the input buffer */
+static inline void cs_rx_endp_done(struct conn_stream *cs)
{
- si->flags |= SI_FL_RX_WAIT_EP;
+ cs->endp->flags |= CS_EP_RX_WAIT_EP;
}
-/* Tell a stream interface the input channel is OK with it sending it some data */
-static inline void si_rx_chan_rdy(struct stream_interface *si)
+/* Tell a conn-stream the input channel is OK with it sending it some data */
+static inline void cs_rx_chan_rdy(struct conn_stream *cs)
{
- si->flags &= ~SI_FL_RXBLK_CHAN;
+ cs->endp->flags &= ~CS_EP_RXBLK_CHAN;
}
-/* Tell a stream interface the input channel is not OK with it sending it some data */
-static inline void si_rx_chan_blk(struct stream_interface *si)
+/* Tell a conn-stream the input channel is not OK with it sending it some data */
+static inline void cs_rx_chan_blk(struct conn_stream *cs)
{
- si->flags |= SI_FL_RXBLK_CHAN;
+ cs->endp->flags |= CS_EP_RXBLK_CHAN;
}
-/* Tell a stream interface the other side is connected */
-static inline void si_rx_conn_rdy(struct stream_interface *si)
+/* Tell a conn-stream the other side is connected */
+static inline void cs_rx_conn_rdy(struct conn_stream *cs)
{
- si->flags &= ~SI_FL_RXBLK_CONN;
+ cs->endp->flags &= ~CS_EP_RXBLK_CONN;
}
-/* Tell a stream interface it must wait for the other side to connect */
-static inline void si_rx_conn_blk(struct stream_interface *si)
+/* Tell a conn-stream it must wait for the other side to connect */
+static inline void cs_rx_conn_blk(struct conn_stream *cs)
{
- si->flags |= SI_FL_RXBLK_CONN;
+ cs->endp->flags |= CS_EP_RXBLK_CONN;
}
-/* The stream interface just got the input buffer it was waiting for */
-static inline void si_rx_buff_rdy(struct stream_interface *si)
+/* The conn-stream just got the input buffer it was waiting for */
+static inline void cs_rx_buff_rdy(struct conn_stream *cs)
{
- si->flags &= ~SI_FL_RXBLK_BUFF;
+ cs->endp->flags &= ~CS_EP_RXBLK_BUFF;
}
-/* The stream interface failed to get an input buffer and is waiting for it.
+/* The conn-stream failed to get an input buffer and is waiting for it.
* Since it indicates a willingness to deliver data to the buffer that will
* have to be retried, we automatically clear RXBLK_ENDP to be called again
* as soon as RXBLK_BUFF is cleared.
*/
-static inline void si_rx_buff_blk(struct stream_interface *si)
+static inline void cs_rx_buff_blk(struct conn_stream *cs)
{
- si->flags |= SI_FL_RXBLK_BUFF;
+ cs->endp->flags |= CS_EP_RXBLK_BUFF;
}
-/* Tell a stream interface some room was made in the input buffer */
-static inline void si_rx_room_rdy(struct stream_interface *si)
+/* Tell a conn-stream some room was made in the input buffer */
+static inline void cs_rx_room_rdy(struct conn_stream *cs)
{
- si->flags &= ~SI_FL_RXBLK_ROOM;
+ cs->endp->flags &= ~CS_EP_RXBLK_ROOM;
}
-/* The stream interface announces it failed to put data into the input buffer
+/* The conn-stream 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, we automatically clear RXBLK_ENDP to
* be called again as soon as RXBLK_ROOM is cleared.
*/
-static inline void si_rx_room_blk(struct stream_interface *si)
+static inline void cs_rx_room_blk(struct conn_stream *cs)
{
- si->flags |= SI_FL_RXBLK_ROOM;
+ cs->endp->flags |= CS_EP_RXBLK_ROOM;
}
-/* The stream interface announces it will never put new data into the input
+/* The conn-stream announces it will never put new data into the input
* buffer and that it's not waiting for its endpoint to deliver anything else.
* This function obviously doesn't have a _rdy equivalent.
*/
-static inline void si_rx_shut_blk(struct stream_interface *si)
+static inline void cs_rx_shut_blk(struct conn_stream *cs)
{
- si->flags |= SI_FL_RXBLK_SHUT;
+ cs->endp->flags |= CS_EP_RXBLK_SHUT;
}
-/* Returns non-zero if the stream interface's Rx path is blocked */
-static inline int si_tx_blocked(const struct stream_interface *si)
+/* Returns non-zero if the conn-stream's Tx path is blocked */
+static inline int cs_tx_blocked(const struct conn_stream *cs)
{
- return !!(si->flags & SI_FL_WAIT_DATA);
+ return !!(cs->endp->flags & CS_EP_WAIT_DATA);
}
-/* Returns non-zero if the stream interface's endpoint is ready to transmit */
-static inline int si_tx_endp_ready(const struct stream_interface *si)
+/* Returns non-zero if the conn-stream's endpoint is ready to transmit */
+static inline int cs_tx_endp_ready(const struct conn_stream *cs)
{
- return (si->flags & SI_FL_WANT_GET);
+ return (cs->endp->flags & CS_EP_WANT_GET);
}
-/* Report that a stream interface wants to get some data from the output buffer */
-static inline void si_want_get(struct stream_interface *si)
+/* Report that a conn-stream wants to get some data from the output buffer */
+static inline void cs_want_get(struct conn_stream *cs)
{
- si->flags |= SI_FL_WANT_GET;
+ cs->endp->flags |= CS_EP_WANT_GET;
}
-/* Report that a stream interface failed to get some data from the output buffer */
-static inline void si_cant_get(struct stream_interface *si)
+/* Report that a conn-stream failed to get some data from the output buffer */
+static inline void cs_cant_get(struct conn_stream *cs)
{
- si->flags |= SI_FL_WANT_GET | SI_FL_WAIT_DATA;
+ cs->endp->flags |= CS_EP_WANT_GET | CS_EP_WAIT_DATA;
}
-/* Report that a stream interface doesn't want to get data from the output buffer */
-static inline void si_stop_get(struct stream_interface *si)
+/* Report that a conn-stream doesn't want to get data from the output buffer */
+static inline void cs_stop_get(struct conn_stream *cs)
{
- si->flags &= ~SI_FL_WANT_GET;
+ cs->endp->flags &= ~CS_EP_WANT_GET;
}
-/* Report that a stream interface won't get any more data from the output buffer */
-static inline void si_done_get(struct stream_interface *si)
+/* Report that a conn-stream won't get any more data from the output buffer */
+static inline void cs_done_get(struct conn_stream *cs)
{
- si->flags &= ~(SI_FL_WANT_GET | SI_FL_WAIT_DATA);
+ cs->endp->flags &= ~(CS_EP_WANT_GET | CS_EP_WAIT_DATA);
}
#endif /* _HAPROXY_STREAM_INTERFACE_H */
diff --git a/src/activity.c b/src/activity.c
index e72b9c7..a78452b 100644
--- a/src/activity.c
+++ b/src/activity.c
@@ -640,7 +640,7 @@
if (ci_putchk(cs_ic(cs), &trash) == -1) {
/* failed, try again */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -690,14 +690,14 @@
if (ci_putchk(cs_ic(cs), &trash) == -1) {
/* failed, try again */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
if (ci_putchk(cs_ic(cs), &trash) == -1) {
/* failed, try again */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -754,13 +754,13 @@
chunk_appendf(&trash, "\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -781,7 +781,7 @@
tot_alloc_bytes - tot_free_bytes);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -968,7 +968,7 @@
if (ci_putchk(cs_ic(cs), &trash) == -1) {
/* failed, try again */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
return 1;
diff --git a/src/applet.c b/src/applet.c
index 21da1a4..ce46ce3 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -105,10 +105,10 @@
struct conn_stream *cs = appctx->owner;
/* allocation requested ? */
- if (!(cs->si->flags & SI_FL_RXBLK_BUFF))
+ if (!(cs->endp->flags & CS_EP_RXBLK_BUFF))
return 0;
- si_rx_buff_rdy(cs->si);
+ cs_rx_buff_rdy(cs);
/* was already allocated another way ? if so, don't take this one */
if (c_size(cs_ic(cs)) || cs_ic(cs)->pipe)
@@ -116,7 +116,7 @@
/* allocation possible now ? */
if (!b_alloc(&cs_ic(cs)->buf)) {
- si_rx_buff_blk(cs->si);
+ cs_rx_buff_blk(cs);
return 0;
}
@@ -141,8 +141,8 @@
* put, it's up to it to change this if needed. This ensures
* that one applet which ignores any event will not spin.
*/
- si_cant_get(cs->si);
- si_rx_endp_done(cs->si);
+ cs_cant_get(cs);
+ cs_rx_endp_done(cs);
/* Now we'll try to allocate the input buffer. We wake up the applet in
* all cases. So this is the applet's responsibility to check if this
@@ -151,7 +151,7 @@
* do if it needs the buffer, it will be called again upon readiness.
*/
if (!cs_alloc_ibuf(cs, &app->buffer_wait))
- si_rx_endp_more(cs->si);
+ cs_rx_endp_more(cs);
count = co_data(cs_oc(cs));
app->applet->fct(app);
@@ -161,15 +161,15 @@
*/
if (count != co_data(cs_oc(cs))) {
cs_oc(cs)->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA;
- si_rx_room_rdy(cs_opposite(cs)->si);
+ cs_rx_room_rdy(cs_opposite(cs));
}
/* measure the call rate and check for anomalies when too high */
rate = update_freq_ctr(&app->call_rate, 1);
if (rate >= 100000 && app->call_rate.prev_ctr && // looped more than 100k times over last second
- ((b_size(cs_ib(cs)) && cs->si->flags & SI_FL_RXBLK_BUFF) || // asks for a buffer which is present
- (b_size(cs_ib(cs)) && !b_data(cs_ib(cs)) && cs->si->flags & SI_FL_RXBLK_ROOM) || // asks for room in an empty buffer
- (b_data(cs_ob(cs)) && si_tx_endp_ready(cs->si) && !si_tx_blocked(cs->si)) || // asks for data already present
+ ((b_size(cs_ib(cs)) && cs->endp->flags & CS_EP_RXBLK_BUFF) || // asks for a buffer which is present
+ (b_size(cs_ib(cs)) && !b_data(cs_ib(cs)) && cs->endp->flags & CS_EP_RXBLK_ROOM) || // asks for room in an empty buffer
+ (b_data(cs_ob(cs)) && cs_tx_endp_ready(cs) && !cs_tx_blocked(cs)) || // asks for data already present
(!b_data(cs_ib(cs)) && b_data(cs_ob(cs)) && // didn't return anything ...
(cs_oc(cs)->flags & (CF_WRITE_PARTIAL|CF_SHUTW_NOW)) == CF_SHUTW_NOW))) { // ... and left data pending after a shut
stream_dump_and_crash(&app->obj_type, read_freq_ctr(&app->call_rate));
diff --git a/src/cache.c b/src/cache.c
index 3e725c7..99f43ee 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1447,7 +1447,7 @@
/* Check if the input buffer is available. */
if (!b_size(&res->buf)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
@@ -1492,7 +1492,7 @@
if (len) {
ret = htx_cache_dump_msg(appctx, res_htx, len, HTX_BLK_UNUSED);
if (ret < len) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
}
@@ -2583,7 +2583,7 @@
if (!next_key) {
chunk_printf(&trash, "%p: %s (shctx:%p, available blocks:%d)\n", cache, cache->id, shctx_ptr(cache), shctx_ptr(cache)->nbav);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
@@ -2621,7 +2621,7 @@
shctx_unlock(shctx_ptr(cache));
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
diff --git a/src/cli.c b/src/cli.c
index f5c3811..77d8f0a 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -930,7 +930,7 @@
* would want to return some info right after parsing.
*/
if (buffer_almost_full(cs_ib(cs))) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
break;
}
@@ -1070,7 +1070,7 @@
appctx->st0 = CLI_ST_PROMPT;
}
else
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
break;
case CLI_ST_CALLBACK: /* use custom pointer */
@@ -1110,7 +1110,7 @@
if (ci_putstr(cs_ic(cs), prompt) != -1)
appctx->st0 = CLI_ST_GETREQ;
else
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
}
/* If the output functions are still there, it means they require more room. */
@@ -1214,7 +1214,7 @@
chunk_printf(&trash, "%s\n", *var);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
if (appctx->st2 == STAT_ST_END)
@@ -1406,7 +1406,7 @@
chunk_appendf(&trash, "%s\n", suspicious ? " !" : "");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
appctx->ctx.cli.i0 = fd;
ret = 0;
break;
@@ -1520,7 +1520,7 @@
if (ci_putchk(cs_ic(cs), &trash) == -1) {
chunk_reset(&trash);
chunk_printf(&trash, "[output too large, cannot dump]\n");
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
}
#undef SHOW_AVG
@@ -1544,7 +1544,7 @@
case STAT_ST_INIT:
chunk_printf(&trash, "# socket lvl processes\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
appctx->st2 = STAT_ST_LIST;
@@ -1606,7 +1606,7 @@
chunk_appendf(&trash, "all\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 1bfdace..620b55d 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -418,7 +418,7 @@
cs_attach_applet(cs, appctx, appctx);
appctx->owner = cs;
appctx->t->nice = __cs_strm(cs)->task->nice;
- si_cant_get(cs->si);
+ cs_cant_get(cs);
appctx_wakeup(appctx);
return appctx;
}
@@ -443,7 +443,7 @@
{
struct channel *ic = cs_ic(cs);
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
if (ic->flags & CF_SHUTR)
return;
ic->flags |= CF_SHUTR;
@@ -483,7 +483,7 @@
return;
oc->flags |= CF_SHUTW;
oc->wex = TICK_ETERNITY;
- si_done_get(cs->si);
+ cs_done_get(cs);
if (tick_isset(cs->hcto)) {
ic->rto = cs->hcto;
@@ -513,7 +513,7 @@
/* fall through */
default:
cs->flags &= ~CS_FL_NOLINGER;
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
ic->flags |= CF_SHUTR;
ic->rex = TICK_ETERNITY;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -535,7 +535,7 @@
if (ic->pipe) {
/* stop reading */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
}
else {
/* (re)start reading */
@@ -556,14 +556,14 @@
if (unlikely(cs->state != CS_ST_EST || (oc->flags & CF_SHUTW)))
return;
- if (!(cs->si->flags & SI_FL_WAIT_DATA) || /* not waiting for data */
+ if (!(cs->endp->flags & CS_EP_WAIT_DATA) || /* not waiting for data */
channel_is_empty(oc)) /* called with nothing to send ! */
return;
/* Otherwise there are remaining data to be sent in the buffer,
* so we tell the handler.
*/
- cs->si->flags &= ~SI_FL_WAIT_DATA;
+ cs->endp->flags &= ~CS_EP_WAIT_DATA;
if (!tick_isset(oc->wex))
oc->wex = tick_add_ifset(now_ms, oc->wto);
@@ -587,7 +587,7 @@
BUG_ON(!cs_conn(cs));
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
if (ic->flags & CF_SHUTR)
return;
ic->flags |= CF_SHUTR;
@@ -627,7 +627,7 @@
return;
oc->flags |= CF_SHUTW;
oc->wex = TICK_ETERNITY;
- si_done_get(cs->si);
+ cs_done_get(cs);
if (tick_isset(cs->hcto)) {
ic->rto = cs->hcto;
@@ -682,7 +682,7 @@
/* fall through */
default:
cs->flags &= ~CS_FL_NOLINGER;
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
ic->flags |= CF_SHUTR;
ic->rex = TICK_ETERNITY;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -724,7 +724,7 @@
return;
if (!oc->pipe && /* spliced data wants to be forwarded ASAP */
- !(cs->si->flags & SI_FL_WAIT_DATA)) /* not waiting for data */
+ !(cs->endp->flags & CS_EP_WAIT_DATA)) /* not waiting for data */
return;
if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(cs_oc(cs)))
@@ -754,14 +754,14 @@
}
if ((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == 0)
- cs->si->flags |= SI_FL_WAIT_DATA;
+ cs->endp->flags |= CS_EP_WAIT_DATA;
oc->wex = TICK_ETERNITY;
}
else {
/* Otherwise there are remaining data to be sent in the buffer,
* which means we have to poll before doing so.
*/
- cs->si->flags &= ~SI_FL_WAIT_DATA;
+ cs->endp->flags &= ~CS_EP_WAIT_DATA;
if (!tick_isset(oc->wex))
oc->wex = tick_add_ifset(now_ms, oc->wto);
}
@@ -814,7 +814,7 @@
BUG_ON(!cs_appctx(cs));
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
if (ic->flags & CF_SHUTR)
return;
ic->flags |= CF_SHUTR;
@@ -855,7 +855,7 @@
return;
oc->flags |= CF_SHUTW;
oc->wex = TICK_ETERNITY;
- si_done_get(cs->si);
+ cs_done_get(cs);
if (tick_isset(cs->hcto)) {
ic->rto = cs->hcto;
@@ -889,7 +889,7 @@
/* fall through */
default:
cs->flags &= ~CS_FL_NOLINGER;
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
ic->flags |= CF_SHUTR;
ic->rex = TICK_ETERNITY;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -929,7 +929,7 @@
/* we only wake the applet up if it was waiting for some data */
- if (!(cs->si->flags & SI_FL_WAIT_DATA))
+ if (!(cs->endp->flags & CS_EP_WAIT_DATA))
return;
if (!tick_isset(oc->wex))
@@ -956,19 +956,19 @@
struct channel *ic = cs_ic(cs);
if (ic->flags & CF_SHUTR) {
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
return;
}
/* Read not closed, update FD status and timeout for reads */
if (ic->flags & CF_DONT_READ)
- si_rx_chan_blk(cs->si);
+ cs_rx_chan_blk(cs);
else
- si_rx_chan_rdy(cs->si);
+ cs_rx_chan_rdy(cs);
if (!channel_is_empty(ic) || !channel_may_recv(ic)) {
/* stop reading, imposed by channel's policy or contents */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
}
else {
/* (re)start reading and update timeout. Note: we don't recompute the timeout
@@ -976,9 +976,9 @@
* update it if is was not yet set. The stream socket handler will already
* have updated it if there has been a completed I/O.
*/
- si_rx_room_rdy(cs->si);
+ cs_rx_room_rdy(cs);
}
- if (cs->si->flags & SI_FL_RXBLK_ANY & ~SI_FL_RX_WAIT_EP)
+ if (cs->endp->flags & CS_EP_RXBLK_ANY & ~CS_EP_RX_WAIT_EP)
ic->rex = TICK_ETERNITY;
else if (!(ic->flags & CF_READ_NOEXP) && !tick_isset(ic->rex))
ic->rex = tick_add_ifset(now_ms, ic->rto);
@@ -1006,9 +1006,9 @@
/* Write not closed, update FD status and timeout for writes */
if (channel_is_empty(oc)) {
/* stop writing */
- if (!(cs->si->flags & SI_FL_WAIT_DATA)) {
+ if (!(cs->endp->flags & CS_EP_WAIT_DATA)) {
if ((oc->flags & CF_SHUTW_NOW) == 0)
- cs->si->flags |= SI_FL_WAIT_DATA;
+ cs->endp->flags |= CS_EP_WAIT_DATA;
oc->wex = TICK_ETERNITY;
}
return;
@@ -1019,7 +1019,7 @@
* update it if is was not yet set. The stream socket handler will already
* have updated it if there has been a completed I/O.
*/
- cs->si->flags &= ~SI_FL_WAIT_DATA;
+ cs->endp->flags &= ~CS_EP_WAIT_DATA;
if (!tick_isset(oc->wex)) {
oc->wex = tick_add_ifset(now_ms, oc->wto);
if (tick_isset(ic->rex) && !(cs->flags & CS_FL_INDEP_STR)) {
diff --git a/src/debug.c b/src/debug.c
index 1e83c11..0ccb29f 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -306,7 +306,7 @@
if (ci_putchk(cs_ic(cs), &trash) == -1) {
/* failed, try again */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
appctx->st1 = thr;
return 0;
}
@@ -1174,7 +1174,7 @@
chunk_appendf(&trash, "\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
appctx->ctx.cli.i0 = fd;
ret = 0;
break;
@@ -1274,7 +1274,7 @@
(unsigned long)(ptr->calls ? (ptr->size / ptr->calls) : 0));
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
appctx->ctx.cli.p0 = ptr;
ret = 0;
break;
diff --git a/src/dns.c b/src/dns.c
index 59b921c..9c989c5 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -443,9 +443,9 @@
* to be notified whenever the connection completes.
*/
if (cs_opposite(cs)->state < CS_ST_EST) {
- si_cant_get(cs->si);
- si_rx_conn_blk(cs->si);
- si_rx_endp_more(cs->si);
+ cs_cant_get(cs);
+ cs_rx_conn_blk(cs);
+ cs_rx_endp_more(cs);
return;
}
@@ -507,7 +507,7 @@
/* check if there is enough room to put message len and query id */
if (available_room < sizeof(slen) + sizeof(new_qid)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -565,7 +565,7 @@
/* check if it remains available room on output chan */
if (unlikely(!available_room)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -593,7 +593,7 @@
* check available_room is large
* enough here.
*/
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -601,7 +601,7 @@
if (ds->tx_msg_offset) {
/* msg was not fully processed, we must be awake to drain pending data */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -621,7 +621,7 @@
BUG_ON(LIST_INLIST(&appctx->wait_entry));
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(DNS_LOCK, &ring->lock);
- si_rx_endp_done(cs->si);
+ cs_rx_endp_done(cs);
}
read:
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 348608e..8c15d3d 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1148,7 +1148,7 @@
ret = ci_putblk(cs_ic(cs), buf, framesz+4);
if (ret <= 0) {
if ((ret == -3 && b_is_null(&cs_ic(cs)->buf)) || ret == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 1; /* retry */
}
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
@@ -1192,8 +1192,8 @@
static int
spoe_wakeup_appctx(struct appctx *appctx)
{
- si_want_get(cs_si(appctx->owner));
- si_rx_endp_more(cs_si(appctx->owner));
+ cs_want_get(appctx->owner);
+ cs_rx_endp_more(appctx->owner);
appctx_wakeup(appctx);
return 1;
}
@@ -1352,7 +1352,7 @@
if (!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST)) {
/* not connected yet */
- si_rx_endp_more(cs->si);
+ cs_rx_endp_more(cs);
task_wakeup(__cs_strm(cs)->task, TASK_WOKEN_MSG);
goto stop;
}
@@ -2034,7 +2034,7 @@
stream_set_backend(strm, conf->agent->b.be);
/* applet is waiting for data */
- si_cant_get(cs_si(strm->csf));
+ cs_cant_get(strm->csf);
appctx_wakeup(appctx);
strm->do_log = NULL;
diff --git a/src/hlua.c b/src/hlua.c
index d39732c..6250f40 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -1932,9 +1932,9 @@
* to be notified whenever the connection completes.
*/
if (cs_opposite(cs)->state < CS_ST_EST) {
- si_cant_get(cs->si);
- si_rx_conn_blk(cs->si);
- si_rx_endp_more(cs->si);
+ cs_cant_get(cs);
+ cs_rx_conn_blk(cs);
+ cs_rx_endp_more(cs);
return;
}
@@ -1959,7 +1959,7 @@
* to write, so we clear the blocking flag.
*/
if (notification_registered(&appctx->ctx.hlua_cosocket.wake_on_write))
- si_rx_endp_more(cs->si);
+ cs_rx_endp_more(cs);
}
/* This function is called when the "struct stream" is destroyed.
@@ -2792,8 +2792,8 @@
/* inform the stream that we want to be notified whenever the
* connection completes.
*/
- si_cant_get(cs_si(s->csf));
- si_rx_endp_more(cs_si(s->csf));
+ cs_cant_get(s->csf);
+ cs_rx_endp_more(s->csf);
appctx_wakeup(appctx);
hlua->gc_count++;
@@ -4452,7 +4452,7 @@
/* Data not yet available. return yield. */
if (ret == 0) {
- si_cant_get(cs->si);
+ cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_getline_yield, TICK_ETERNITY, 0));
}
@@ -4507,7 +4507,7 @@
/* Data not yet available. return yield. */
if (ret == 0) {
- si_cant_get(cs->si);
+ cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_recv_yield, TICK_ETERNITY, 0));
}
@@ -4530,7 +4530,7 @@
luaL_addlstring(&luactx->b, blk1, len1);
luaL_addlstring(&luactx->b, blk2, len2);
co_skip(cs_oc(cs), len1 + len2);
- si_cant_get(cs->si);
+ cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_recv_yield, TICK_ETERNITY, 0));
} else {
@@ -4554,7 +4554,7 @@
if (len > 0) {
lua_pushinteger(L, len);
lua_replace(L, 2);
- si_cant_get(cs->si);
+ cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_recv_yield, TICK_ETERNITY, 0));
}
@@ -4623,7 +4623,7 @@
* applet, and returns a yield.
*/
if (l < len) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_send_yield, TICK_ETERNITY, 0));
}
@@ -4993,7 +4993,7 @@
htx_to_buf(htx, &req->buf);
if (!stop) {
- si_cant_get(cs->si);
+ cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_getline_yield, TICK_ETERNITY, 0));
}
@@ -5091,7 +5091,7 @@
lua_pushinteger(L, len);
lua_replace(L, 2);
}
- si_cant_get(cs->si);
+ cs_cant_get(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_recv_yield, TICK_ETERNITY, 0));
}
@@ -5163,7 +5163,7 @@
if (l < len) {
snd_yield:
htx_to_buf(htx, &res->buf);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_send_yield, TICK_ETERNITY, 0));
}
@@ -5467,7 +5467,7 @@
struct channel *res = cs_ic(cs);
if (co_data(res)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_http_start_response_yield, TICK_ETERNITY, 0));
}
return MAY_LJMP(hlua_applet_http_send_response(L));
@@ -9261,8 +9261,8 @@
RESET_SAFE_LJMP(hlua);
/* Wakeup the applet ASAP. */
- si_cant_get(cs->si);
- si_rx_endp_more(cs->si);
+ cs_cant_get(cs);
+ cs_rx_endp_more(cs);
return 1;
}
@@ -9455,7 +9455,7 @@
RESET_SAFE_LJMP(hlua);
/* Wakeup the applet when data is ready for read. */
- si_cant_get(cs->si);
+ cs_cant_get(cs);
return 1;
}
@@ -9479,7 +9479,7 @@
/* Check if the input buffer is available. */
if (!b_size(&res->buf)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
/* check that the output is not closed */
@@ -9490,7 +9490,7 @@
if (!HLUA_IS_RUNNING(hlua) &&
!(ctx->ctx.hlua_apphttp.flags & APPLET_DONE)) {
if (!co_data(req)) {
- si_cant_get(cs->si);
+ cs_cant_get(cs);
goto out;
}
}
@@ -9559,7 +9559,7 @@
*/
if (htx_is_empty(res_htx) && (strm->txn->rsp.flags & (HTTP_MSGF_XFER_LEN|HTTP_MSGF_CNT_LEN)) == HTTP_MSGF_XFER_LEN) {
if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
channel_add_input(res, 1);
@@ -10113,7 +10113,7 @@
case HLUA_E_AGAIN:
/* We want write. */
if (HLUA_IS_WAKERESWR(hlua))
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
/* Set the timeout. */
if (hlua->wake_time != TICK_ETERNITY)
task_schedule(hlua->task, hlua->wake_time);
diff --git a/src/http_ana.c b/src/http_ana.c
index 8147cf3..62befbd 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -1247,7 +1247,7 @@
req->flags &= ~(CF_WRITE_ERROR | CF_WRITE_TIMEOUT | CF_SHUTW | CF_SHUTW_NOW);
res->flags &= ~(CF_READ_ERROR | CF_READ_TIMEOUT | CF_SHUTR | CF_EOI | CF_READ_NULL | CF_SHUTR_NOW);
res->analysers &= AN_RES_FLT_END;
- si->flags &= ~SI_FL_RXBLK_SHUT;
+ si->cs->endp->flags &= ~CS_EP_RXBLK_SHUT;
s->conn_err_type = STRM_ET_NONE;
s->flags &= ~(SF_CONN_EXP | SF_ERR_MASK | SF_FINST_MASK);
s->conn_exp = TICK_ETERNITY;
@@ -4140,7 +4140,7 @@
if ((htx->flags & HTX_FL_EOM) ||
htx_get_tail_type(htx) > HTX_BLK_DATA ||
channel_htx_full(chn, htx, global.tune.maxrewrite) ||
- si_rx_blocked_room(chn_prod(chn)->si))
+ cs_rx_blocked_room(chn_prod(chn)))
goto end;
if (bytes) {
diff --git a/src/http_client.c b/src/http_client.c
index cdd0d87..6415e31 100644
--- a/src/http_client.c
+++ b/src/http_client.c
@@ -178,7 +178,7 @@
chunk_appendf(trash, "%.*s %d %.*s\n", (unsigned int)istlen(hc->res.vsn), istptr(hc->res.vsn),
hc->res.status, (unsigned int)istlen(hc->res.reason), istptr(hc->res.reason));
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
appctx->ctx.cli.i0 &= ~HC_CLI_F_RES_STLINE;
goto out;
}
@@ -192,7 +192,7 @@
if (!chunk_memcat(trash, "\r\n", 2))
goto out;
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
appctx->ctx.cli.i0 &= ~HC_CLI_F_RES_HDR;
goto out;
}
@@ -220,7 +220,7 @@
out:
/* we didn't clear every flags, we should come back to finish things */
if (appctx->ctx.cli.i0)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
return 0;
@@ -531,7 +531,7 @@
s->res.flags |= CF_READ_DONTWAIT;
/* applet is waiting for data */
- si_cant_get(cs_si(s->csf));
+ cs_cant_get(s->csf);
appctx_wakeup(appctx);
hc->appctx = appctx;
@@ -926,13 +926,13 @@
process_data:
- si_rx_chan_rdy(cs->si);
+ cs_rx_chan_rdy(cs);
return;
more:
/* There was not enough data in the response channel */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
if (appctx->st0 == HTTPCLIENT_S_RES_END)
goto end;
diff --git a/src/map.c b/src/map.c
index 54c78b6..c17905b 100644
--- a/src/map.c
+++ b/src/map.c
@@ -390,7 +390,7 @@
*/
LIST_APPEND(&elt->back_refs, &appctx->ctx.map.bref.users);
HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
skip:
@@ -419,7 +419,7 @@
chunk_reset(&trash);
chunk_appendf(&trash, "# id (file) description\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -450,7 +450,7 @@
/* let's try again later from this stream. We add ourselves into
* this stream's users so that it can remove us upon termination.
*/
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -571,7 +571,7 @@
* this stream's users so that it can remove us upon termination.
*/
HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -1003,7 +1003,7 @@
if (!finished) {
/* let's come back later */
- si_rx_endp_more(cs_si(appctx->owner));
+ cs_rx_endp_more(appctx->owner);
return 0;
}
return 1;
diff --git a/src/mworker.c b/src/mworker.c
index cac4a5b..eb4a2be 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -606,7 +606,7 @@
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
diff --git a/src/peers.c b/src/peers.c
index a6544a2..a366e2f 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1186,7 +1186,7 @@
if (ret <= 0) {
if (ret == -1) {
/* No more write possible */
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return -1;
}
appctx->st0 = PEER_SESS_ST_END;
@@ -2833,7 +2833,7 @@
/* Check if the input buffer is available. */
if (cs_ib(cs)->size == 0) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
@@ -3205,7 +3205,7 @@
s = DISGUISE(cs_strm(cs));
/* applet is waiting for data */
- si_cant_get(cs_si(s->csf));
+ cs_cant_get(s->csf);
appctx_wakeup(appctx);
/* initiate an outgoing connection */
@@ -3756,7 +3756,7 @@
peers->sync_task ? peers->sync_task->calls : 0);
if (ci_putchk(cs_ic(cs), msg) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -3915,7 +3915,7 @@
end:
chunk_appendf(&trash, "\n");
if (ci_putchk(cs_ic(cs), msg) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
diff --git a/src/pool.c b/src/pool.c
index 25a3c7d..b1d30f1 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -1010,7 +1010,7 @@
dump_pools_to_trash();
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
return 1;
diff --git a/src/proxy.c b/src/proxy.c
index 0dcc830..bfad7ac 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -2717,7 +2717,7 @@
}
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
@@ -2750,7 +2750,7 @@
global.nbthread);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
appctx->st2 = STAT_ST_INFO;
@@ -2785,7 +2785,7 @@
if (!appctx->ctx.cli.p0) {
chunk_printf(&trash, "# name\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
appctx->ctx.cli.p0 = proxies_list;
@@ -2800,7 +2800,7 @@
chunk_appendf(&trash, "%s\n", curproxy->id);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
}
@@ -3238,7 +3238,7 @@
cant_send_unlock:
HA_RWLOCK_RDUNLOCK(PROXY_LOCK, &appctx->ctx.errors.px->lock);
cant_send:
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
diff --git a/src/resolvers.c b/src/resolvers.c
index 85373a2..f066182 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -2611,7 +2611,7 @@
return 1;
full:
- si_rx_room_rdy(cs->si);
+ cs_rx_room_rdy(cs);
return 0;
}
@@ -2657,7 +2657,7 @@
return 1;
full:
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -2795,7 +2795,7 @@
/* let's try again later from this session. We add ourselves into
* this session's users so that it can remove us upon termination.
*/
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
/* fall through */
diff --git a/src/ring.c b/src/ring.c
index 1668ee3..dc7b11c 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -346,7 +346,7 @@
trash.area[trash.data++] = '\n';
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -367,7 +367,7 @@
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
- si_rx_endp_done(cs->si);
+ cs_rx_endp_done(cs);
ret = 0;
}
/* always drain all the request */
diff --git a/src/server.c b/src/server.c
index 5918819..bda77ca 100644
--- a/src/server.c
+++ b/src/server.c
@@ -4339,7 +4339,7 @@
snprintf(trash.area, trash.size, "%d (initial %d)\n", sv->uweight,
sv->iweight);
if (ci_putstr(cs_ic(cs), trash.area) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
return 1;
diff --git a/src/sink.c b/src/sink.c
index 204f96a..cb60b95 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -330,9 +330,9 @@
* to be notified whenever the connection completes.
*/
if (cs_opposite(cs)->state < CS_ST_EST) {
- si_cant_get(cs->si);
- si_rx_conn_blk(cs->si);
- si_rx_endp_more(cs->si);
+ cs_cant_get(cs);
+ cs_rx_conn_blk(cs);
+ cs_rx_endp_more(cs);
return;
}
@@ -397,7 +397,7 @@
trash.area[trash.data++] = '\n';
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -415,7 +415,7 @@
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
- si_rx_endp_done(cs->si);
+ cs_rx_endp_done(cs);
}
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
@@ -470,9 +470,9 @@
* to be notified whenever the connection completes.
*/
if (cs_opposite(cs)->state < CS_ST_EST) {
- si_cant_get(cs->si);
- si_rx_conn_blk(cs->si);
- si_rx_endp_more(cs->si);
+ cs_cant_get(cs);
+ cs_rx_conn_blk(cs);
+ cs_rx_endp_more(cs);
return;
}
@@ -541,7 +541,7 @@
trash.data += b_getblk(buf, p + 1, msg_len, ofs + cnt);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
ret = 0;
break;
}
@@ -559,7 +559,7 @@
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
- si_rx_endp_done(cs->si);
+ cs_rx_endp_done(cs);
}
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c
index f8dc3cb..8b709f0 100644
--- a/src/ssl_ckch.c
+++ b/src/ssl_ckch.c
@@ -1261,7 +1261,7 @@
node = ebmb_next(node);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
}
@@ -1665,7 +1665,7 @@
end:
if (ci_putchk(cs_ic(cs), out) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
@@ -1710,7 +1710,7 @@
}
if (ci_putchk(cs_ic(cs), out) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
@@ -1979,7 +1979,7 @@
/* This state just print the update message */
chunk_printf(trash, "Committing %s", ckchs_transaction.path);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
appctx->st2 = SETCERT_ST_GEN;
@@ -2054,16 +2054,16 @@
chunk_appendf(trash, "\n");
chunk_appendf(trash, "Success!\n");
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
/* success: call the release function and don't come back */
return 1;
yield:
/* store the state */
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
- si_rx_endp_more(cs->si); /* let's come back later */
+ cs_rx_endp_more(cs); /* let's come back later */
return 0; /* should come back */
error:
@@ -2071,7 +2071,7 @@
if (trash) {
chunk_appendf(trash, "\n%sFailed!\n", err);
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
}
/* error: call the release function and don't come back */
@@ -2728,7 +2728,7 @@
goto error;
}
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
appctx->st2 = SETCERT_ST_GEN;
@@ -2839,16 +2839,16 @@
chunk_appendf(trash, "\n");
chunk_appendf(trash, "Success!\n");
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
/* success: call the release function and don't come back */
return 1;
yield:
/* store the state */
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
- si_rx_endp_more(cs->si); /* let's come back later */
+ cs_rx_endp_more(cs); /* let's come back later */
return 0; /* should come back */
error:
@@ -2856,7 +2856,7 @@
if (trash) {
chunk_appendf(trash, "\n%sFailed!\n", err);
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
}
/* error: call the release function and don't come back */
@@ -2972,7 +2972,7 @@
end:
if (ci_putchk(cs_ic(cs), out) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
@@ -3111,7 +3111,7 @@
node = ebmb_next(node);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
}
@@ -3631,7 +3631,7 @@
end:
if (ci_putchk(cs_ic(cs), out) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
@@ -3743,7 +3743,7 @@
node = ebmb_next(node);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
}
diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c
index f2d6496..c940829 100644
--- a/src/ssl_crtlist.c
+++ b/src/ssl_crtlist.c
@@ -902,7 +902,7 @@
while (lnode) {
chunk_appendf(trash, "%s\n", lnode->key);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
lnode = ebmb_next(lnode);
@@ -933,7 +933,7 @@
entry = LIST_ELEM((crtlist->ord_entries).n, typeof(entry), by_crtlist);
chunk_appendf(trash, "# %s\n", crtlist->node.key);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
}
@@ -952,7 +952,7 @@
chunk_appendf(trash, "\n");
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
}
@@ -1068,7 +1068,7 @@
/* This state just print the update message */
chunk_printf(trash, "Inserting certificate '%s' in crt-list '%s'", store->path, crtlist->node.key);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
appctx->st2 = SETCERT_ST_GEN;
@@ -1129,16 +1129,16 @@
chunk_appendf(trash, "%s", err);
chunk_appendf(trash, "Success!\n");
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
/* success: call the release function and don't come back */
return 1;
yield:
/* store the state */
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
- si_rx_endp_more(cs->si); /* let's come back later */
+ cs_rx_endp_more(cs); /* let's come back later */
return 0; /* should come back */
error:
@@ -1146,7 +1146,7 @@
if (trash) {
chunk_appendf(trash, "\n%sFailed!\n", err);
if (ci_putchk(cs_ic(cs), trash) == -1)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
free_trash_chunk(trash);
}
/* error: call the release function and don't come back */
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index bdd73e2..23d1ca1 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -7212,7 +7212,7 @@
chunk_appendf(&trash, "# id (file)\n");
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -7272,7 +7272,7 @@
* this stream's users so that it can remove us upon termination.
*/
HA_RWLOCK_RDUNLOCK(TLSKEYS_REF_LOCK, &ref->lock);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
appctx->ctx.cli.i1++;
@@ -7284,7 +7284,7 @@
/* let's try again later from this stream. We add ourselves into
* this stream's users so that it can remove us upon termination.
*/
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -7528,7 +7528,7 @@
node = ebmb_next(node);
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
}
@@ -7672,7 +7672,7 @@
}
if (ci_putchk(cs_ic(cs), trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto yield;
}
appctx->ctx.cli.p0 = NULL;
diff --git a/src/stats.c b/src/stats.c
index 41ce282..22e0d84 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -3209,7 +3209,7 @@
}
full:
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -3700,7 +3700,7 @@
return 1;
full:
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -3803,7 +3803,7 @@
}
full:
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -4196,7 +4196,7 @@
full:
htx_reset(htx);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -4255,7 +4255,7 @@
full:
htx_reset(htx);
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -4283,7 +4283,7 @@
/* Check if the input buffer is available. */
if (!b_size(&res->buf)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
@@ -4326,7 +4326,7 @@
*/
if (htx_is_empty(res_htx)) {
if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto out;
}
channel_add_input(res, 1);
@@ -4361,7 +4361,7 @@
*/
htx_to_buf(res_htx, &res->buf);
if (!channel_is_empty(res))
- si_stop_get(cs->si);
+ cs_stop_get(cs);
}
/* Dump all fields from <info> into <out> using the "show info" format (name: value) */
@@ -4549,7 +4549,7 @@
stats_dump_info_fields(&trash, info, appctx->ctx.stats.flags);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -4777,7 +4777,7 @@
stats_dump_json_schema(&trash);
if (ci_putchk(cs_ic(cs), &trash) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
diff --git a/src/stick_table.c b/src/stick_table.c
index 664de04..2ef82cc 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -4253,7 +4253,7 @@
chunk_appendf(msg, "# contents not dumped due to insufficient privileges\n");
if (ci_putchk(cs_ic(cs), msg) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
@@ -4380,7 +4380,7 @@
chunk_appendf(msg, "\n");
if (ci_putchk(cs_ic(cs), msg) == -1) {
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
diff --git a/src/stream.c b/src/stream.c
index b860945..e74a4cf 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -306,7 +306,7 @@
/* Callback used to wake up a stream when an input buffer is available. The
* stream <s>'s stream interfaces are checked for a failed buffer allocation
- * as indicated by the presence of the SI_FL_RXBLK_ROOM flag and the lack of a
+ * as indicated by the presence of the CS_EP_RXBLK_ROOM flag and the lack of a
* buffer, and and input buffer is assigned there (at most one). The function
* returns 1 and wakes the stream up if a buffer was taken, otherwise zero.
* It's designed to be called from __offer_buffer().
@@ -315,12 +315,12 @@
{
struct stream *s = arg;
- if (!s->req.buf.size && !s->req.pipe && (cs_si(s->csf)->flags & SI_FL_RXBLK_BUFF) &&
+ if (!s->req.buf.size && !s->req.pipe && (s->csf->endp->flags & CS_EP_RXBLK_BUFF) &&
b_alloc(&s->req.buf))
- si_rx_buff_rdy(cs_si(s->csf));
- else if (!s->res.buf.size && !s->res.pipe && (cs_si(s->csb)->flags & SI_FL_RXBLK_BUFF) &&
+ cs_rx_buff_rdy(s->csf);
+ else if (!s->res.buf.size && !s->res.pipe && (s->csb->endp->flags & CS_EP_RXBLK_BUFF) &&
b_alloc(&s->res.buf))
- si_rx_buff_rdy(cs_si(s->csb));
+ cs_rx_buff_rdy(s->csb);
else
return 0;
@@ -540,7 +540,7 @@
/* finish initialization of the accepted file descriptor */
if (cs_appctx(cs))
- si_want_get(cs_si(s->csf));
+ cs_want_get(s->csf);
if (sess->fe->accept && sess->fe->accept(s) < 0)
goto out_fail_accept;
@@ -937,7 +937,7 @@
rep->analysers |= strm_fe(s)->fe_rsp_ana | s->be->be_rsp_ana;
- si_rx_endp_more(si);
+ cs_rx_endp_more(s->csb);
rep->flags |= CF_READ_ATTACHED; /* producer is now attached */
if (conn) {
/* real connections have timeouts
@@ -1034,7 +1034,7 @@
}
/* Now we can schedule the applet. */
- si_cant_get(cs_si(s->csb));
+ cs_cant_get(s->csb);
appctx_wakeup(appctx);
return ACT_RET_STOP;
}
@@ -1497,7 +1497,7 @@
conn = cs_conn(cs);
if (conn) {
- si_rx_endp_more(cs_si(s->csf));
+ cs_rx_endp_more(s->csf);
/* Make sure we're unsubscribed, the the new
* mux will probably want to subscribe to
* the underlying XPRT
@@ -1566,13 +1566,13 @@
* handled at the latest moment.
*/
if (cs_appctx(csf)) {
- if ((si_rx_endp_ready(csf->si) && !si_rx_blocked(csf->si)) ||
- (si_tx_endp_ready(csf->si) && !si_tx_blocked(csf->si)))
+ if ((cs_rx_endp_ready(csf) && !cs_rx_blocked(csf)) ||
+ (cs_tx_endp_ready(csf) && !cs_tx_blocked(csf)))
appctx_wakeup(__cs_appctx(csf));
}
if (cs_appctx(csb)) {
- if ((si_rx_endp_ready(csb->si) && !si_rx_blocked(csb->si)) ||
- (si_tx_endp_ready(csb->si) && !si_tx_blocked(csb->si)))
+ if ((cs_rx_endp_ready(csb) && !cs_rx_blocked(csb)) ||
+ (cs_tx_endp_ready(csb) && !cs_tx_blocked(csb)))
appctx_wakeup(__cs_appctx(csb));
}
}
@@ -3768,7 +3768,7 @@
return 1;
full:
thread_release();
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
return 0;
}
diff --git a/src/stream_interface.c b/src/stream_interface.c
index 573b072..3e54792 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -88,7 +88,7 @@
* layers (applets, connections) after I/O completion. After updating the stream
* interface and timeouts, it will try to forward what can be forwarded, then to
* wake the associated task up if an important event requires special handling.
- * It may update SI_FL_WAIT_DATA and/or SI_FL_RXBLK_ROOM, that the callers are
+ * It may update CS_EP_WAIT_DATA and/or CS_EP_RXBLK_ROOM, that the callers are
* encouraged to watch to take appropriate action.
* It should not be called from within the stream itself, cs_update()
* is designed for this.
@@ -114,9 +114,9 @@
* we're about to close and can't expect more data if SHUTW_NOW is there.
*/
if (!(oc->flags & (CF_SHUTW|CF_SHUTW_NOW)))
- cs->si->flags |= SI_FL_WAIT_DATA;
+ cs->endp->flags |= CS_EP_WAIT_DATA;
else if ((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW)
- cs->si->flags &= ~SI_FL_WAIT_DATA;
+ cs->endp->flags &= ~CS_EP_WAIT_DATA;
/* update OC timeouts and wake the other side up if it's waiting for room */
if (oc->flags & CF_WRITE_ACTIVITY) {
@@ -131,23 +131,23 @@
}
if (oc->flags & CF_DONT_READ)
- si_rx_chan_blk(cso->si);
+ cs_rx_chan_blk(cso);
else
- si_rx_chan_rdy(cso->si);
+ cs_rx_chan_rdy(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
* are output data, but we avoid doing this if some of the data are
* not yet scheduled for being forwarded, because it is very likely
* that it will be done again immediately afterwards once the following
- * data are parsed (eg: HTTP chunking). We only SI_FL_RXBLK_ROOM once
+ * data are parsed (eg: HTTP chunking). We only CS_EP_RXBLK_ROOM once
* we've emptied *some* of the output buffer, and not just when there
* is available room, because applets are often forced to stop before
* the buffer is full. We must not stop based on input data alone because
* an HTTP parser might need more data to complete the parsing.
*/
if (!channel_is_empty(ic) &&
- (cso->si->flags & SI_FL_WAIT_DATA) &&
+ (cso->endp->flags & CS_EP_WAIT_DATA) &&
(!(ic->flags & CF_EXPECT_MORE) || c_full(ic) || ci_data(ic) == 0 || ic->pipe)) {
int new_len, last_len;
@@ -165,16 +165,16 @@
* buffer or in the pipe.
*/
if (new_len < last_len)
- si_rx_room_rdy(cs->si);
+ cs_rx_room_rdy(cs);
}
if (!(ic->flags & CF_DONT_READ))
- si_rx_chan_rdy(cs->si);
+ cs_rx_chan_rdy(cs);
cs_chk_rcv(cs);
cs_chk_rcv(cso);
- if (si_rx_blocked(cs->si)) {
+ if (cs_rx_blocked(cs)) {
ic->rex = TICK_ETERNITY;
}
else if ((ic->flags & (CF_SHUTR|CF_READ_PARTIAL)) == CF_READ_PARTIAL) {
@@ -439,7 +439,7 @@
if (cs->state == CS_ST_CON)
cs->state = CS_ST_RDY;
- si_rx_room_rdy(cs_opposite(cs)->si);
+ cs_rx_room_rdy(cs_opposite(cs));
}
if (cs->endp->flags & (CS_EP_ERROR|CS_EP_ERR_PENDING)) {
@@ -495,7 +495,7 @@
if (cs->wait_event.events & SUB_RETRY_RECV)
return 0; // already subscribed
- if (!si_rx_endp_ready(cs->si) || si_rx_blocked(cs->si))
+ if (!cs_rx_endp_ready(cs) || cs_rx_blocked(cs))
return 0; // already failed
return cs_conn_recv(cs);
@@ -634,7 +634,7 @@
/* the pipe is full or we have read enough data that it
* could soon be full. Let's stop before needing to poll.
*/
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
goto done_recv;
}
@@ -704,7 +704,7 @@
*/
BUG_ON(c_empty(ic));
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
/* Add READ_PARTIAL because some data are pending but
* cannot be xferred to the channel
*/
@@ -718,7 +718,7 @@
* here to proceed.
*/
if (flags & CO_RFL_BUF_FLUSH)
- si_rx_room_blk(cs->si);
+ cs_rx_room_blk(cs);
break;
}
@@ -748,7 +748,7 @@
if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) {
/* we're stopped by the channel's policy */
- si_rx_chan_blk(cs->si);
+ cs_rx_chan_blk(cs);
break;
}
@@ -763,7 +763,7 @@
*/
if (ic->flags & CF_STREAMER) {
/* we're stopped by the channel's policy */
- si_rx_chan_blk(cs->si);
+ cs_rx_chan_blk(cs);
break;
}
@@ -772,7 +772,7 @@
*/
if (ret >= global.tune.recv_enough) {
/* we're stopped by the channel's policy */
- si_rx_chan_blk(cs->si);
+ cs_rx_chan_blk(cs);
break;
}
}
@@ -780,7 +780,7 @@
/* if we are waiting for more space, don't try to read more data
* right now.
*/
- if (si_rx_blocked(cs->si))
+ if (cs_rx_blocked(cs))
break;
} /* while !flags */
@@ -844,12 +844,12 @@
cs_conn_read0(cs);
ret = 1;
}
- else if (!si_rx_blocked(cs->si)) {
+ else if (!cs_rx_blocked(cs)) {
/* Subscribe to receive events if we're blocking on I/O */
conn->mux->subscribe(cs, SUB_RETRY_RECV, &cs->wait_event);
- si_rx_endp_done(cs->si);
+ cs_rx_endp_done(cs);
} else {
- si_rx_endp_more(cs->si);
+ cs_rx_endp_more(cs);
ret = 1;
}
return ret;
@@ -867,7 +867,7 @@
BUG_ON(!cs_conn(cs));
- si_rx_shut_blk(cs->si);
+ cs_rx_shut_blk(cs);
if (ic->flags & CF_SHUTR)
return;
ic->flags |= CF_SHUTR;
@@ -897,7 +897,7 @@
oc->flags |= CF_SHUTW;
oc->wex = TICK_ETERNITY;
- si_done_get(cs->si);
+ cs_done_get(cs);
cs->state = CS_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -918,14 +918,14 @@
/* If the applet wants to write and the channel is closed, it's a
* broken pipe and it must be reported.
*/
- if (!(cs->si->flags & SI_FL_RX_WAIT_EP) && (ic->flags & CF_SHUTR))
+ if (!(cs->endp->flags & CS_EP_RX_WAIT_EP) && (ic->flags & CF_SHUTR))
cs->endp->flags |= CS_EP_ERROR;
/* automatically mark the applet having data available if it reported
* begin blocked by the channel.
*/
- if (si_rx_blocked(cs->si))
- si_rx_endp_more(cs->si);
+ if (cs_rx_blocked(cs))
+ cs_rx_endp_more(cs);
/* update the stream-int, channels, and possibly wake the stream up */
cs_notify(cs);
@@ -936,8 +936,8 @@
* appctx but in the case the task is not in runqueue we may have to
* wakeup the appctx immediately.
*/
- if ((si_rx_endp_ready(cs->si) && !si_rx_blocked(cs->si)) ||
- (si_tx_endp_ready(cs->si) && !si_tx_blocked(cs->si)))
+ if ((cs_rx_endp_ready(cs) && !cs_rx_blocked(cs)) ||
+ (cs_tx_endp_ready(cs) && !cs_tx_blocked(cs)))
appctx_wakeup(__cs_appctx(cs));
return 0;
}
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index bce62f0..ddae375 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -118,7 +118,7 @@
*/
if ((req->flags & (CF_EOI|CF_SHUTR|CF_READ_ERROR)) || channel_full(req, global.tune.maxrewrite) ||
- si_rx_blocked_room(chn_prod(req)->si) ||
+ cs_rx_blocked_room(chn_prod(req)) ||
!s->be->tcp_req.inspect_delay || tick_is_expired(s->rules_exp, now_ms))
partial = SMP_OPT_FINAL;
else
@@ -301,7 +301,7 @@
* - if one rule returns KO, then return KO
*/
if ((rep->flags & (CF_EOI|CF_SHUTR|CF_READ_ERROR)) || channel_full(rep, global.tune.maxrewrite) ||
- si_rx_blocked_room(chn_prod(rep)->si) ||
+ cs_rx_blocked_room(chn_prod(rep)) ||
!s->be->tcp_rep.inspect_delay || tick_is_expired(s->rules_exp, now_ms))
partial = SMP_OPT_FINAL;
else