CLEANUP: conn_stream: rename the stream endpoint flags CS_EP_* to SE_FL_*
Let's now use the new flag names for the stream endpoint.
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 91aee7f..3caee7c 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -722,9 +722,9 @@
TRACE_ENTER(H1_EV_STRM_NEW, h1c->conn, h1s);
if (h1s->flags & H1S_F_NOT_FIRST)
- se_fl_set(h1s->endp, CS_EP_NOT_FIRST);
+ se_fl_set(h1s->endp, SE_FL_NOT_FIRST);
if (h1s->req.flags & H1_MF_UPG_WEBSOCKET)
- se_fl_set(h1s->endp, CS_EP_WEBSOCKET);
+ se_fl_set(h1s->endp, SE_FL_WEBSOCKET);
if (!cs_new_from_endp(h1s->endp, h1c->conn->owner, input)) {
TRACE_ERROR("CS allocation failure", H1_EV_STRM_NEW|H1_EV_STRM_END|H1_EV_STRM_ERR, h1c->conn, h1s);
@@ -823,7 +823,7 @@
goto fail;
h1s->endp->target = h1s;
h1s->endp->conn = h1c->conn;
- se_fl_set(h1s->endp, CS_EP_T_MUX | CS_EP_ORPHAN);
+ se_fl_set(h1s->endp, SE_FL_T_MUX | SE_FL_ORPHAN);
}
h1s->sess = sess;
@@ -911,7 +911,7 @@
}
HA_ATOMIC_DEC(&h1c->px_counters->open_streams);
- BUG_ON(h1s->endp && !se_fl_test(h1s->endp, CS_EP_ORPHAN));
+ BUG_ON(h1s->endp && !se_fl_test(h1s->endp, SE_FL_ORPHAN));
cs_endpoint_free(h1s->endp);
pool_free(pool_head_h1s, h1s);
}
@@ -1906,11 +1906,11 @@
/* Here h1s->endp->cs is always defined */
if (!(h1m->flags & H1_MF_CHNK) && (h1m->state == H1_MSG_DATA || (h1m->state == H1_MSG_TUNNEL))) {
TRACE_STATE("notify the mux can use splicing", H1_EV_RX_DATA|H1_EV_RX_BODY, h1c->conn, h1s);
- se_fl_set(h1s->endp, CS_EP_MAY_SPLICE);
+ se_fl_set(h1s->endp, SE_FL_MAY_SPLICE);
}
else {
TRACE_STATE("notify the mux can't use splicing anymore", H1_EV_RX_DATA|H1_EV_RX_BODY, h1c->conn, h1s);
- se_fl_clr(h1s->endp, CS_EP_MAY_SPLICE);
+ se_fl_clr(h1s->endp, SE_FL_MAY_SPLICE);
}
/* Set EOI on conn-stream in DONE state iff:
@@ -1922,7 +1922,7 @@
*/
if (((h1m->state == H1_MSG_DONE) && (h1m->flags & H1_MF_RESP)) ||
((h1m->state == H1_MSG_DONE) && (h1s->meth != HTTP_METH_CONNECT) && !(h1m->flags & H1_MF_CONN_UPG)))
- se_fl_set(h1s->endp, CS_EP_EOI);
+ se_fl_set(h1s->endp, SE_FL_EOI);
out:
/* When Input data are pending for this message, notify upper layer that
@@ -1932,20 +1932,20 @@
* - Headers or trailers are pending to be copied.
*/
if (h1s->flags & (H1S_F_RX_CONGESTED)) {
- se_fl_set(h1s->endp, CS_EP_RCV_MORE | CS_EP_WANT_ROOM);
+ se_fl_set(h1s->endp, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
TRACE_STATE("waiting for more room", H1_EV_RX_DATA|H1_EV_H1S_BLK, h1c->conn, h1s);
}
else {
- se_fl_clr(h1s->endp, CS_EP_RCV_MORE | CS_EP_WANT_ROOM);
+ se_fl_clr(h1s->endp, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
if (h1s->flags & H1S_F_REOS) {
- se_fl_set(h1s->endp, CS_EP_EOS);
+ se_fl_set(h1s->endp, SE_FL_EOS);
if (h1m->state >= H1_MSG_DONE || !(h1m->flags & H1_MF_XFER_LEN)) {
/* DONE or TUNNEL or SHUTR without XFER_LEN, set
* EOI on the conn-stream */
- se_fl_set(h1s->endp, CS_EP_EOI);
+ se_fl_set(h1s->endp, SE_FL_EOI);
}
else if (h1m->state > H1_MSG_LAST_LF && h1m->state < H1_MSG_DONE) {
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
TRACE_ERROR("message aborted, set error on CS", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s);
}
@@ -1963,7 +1963,7 @@
err:
htx_to_buf(htx, buf);
- se_fl_set(h1s->endp, CS_EP_EOI);
+ se_fl_set(h1s->endp, SE_FL_EOI);
TRACE_DEVEL("leaving on error", H1_EV_RX_DATA|H1_EV_STRM_ERR, h1c->conn, h1s);
return 0;
}
@@ -2572,7 +2572,7 @@
h1c->flags |= H1C_F_ST_ERROR;
TRACE_ERROR("txn done but data waiting to be sent, set error on h1c", H1_EV_H1C_ERR, h1c->conn, h1s);
}
- se_fl_set(h1s->endp, CS_EP_EOI);
+ se_fl_set(h1s->endp, SE_FL_EOI);
}
TRACE_LEAVE(H1_EV_TX_DATA, h1c->conn, h1s, chn_htx, (size_t[]){total});
@@ -3053,7 +3053,7 @@
TRACE_STATE("read0 on connection", H1_EV_H1C_RECV, conn, h1s);
}
if ((h1c->flags & H1C_F_ST_ERROR) || ((conn->flags & CO_FL_ERROR) && !b_data(&h1c->ibuf)))
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
TRACE_POINT(H1_EV_STRM_WAKE, h1c->conn, h1s);
h1_alert(h1s);
}
@@ -3109,9 +3109,9 @@
BUG_ON(!h1s || h1c->flags & H1C_F_ST_READY);
if (conn_xprt_read0_pending(conn) || (h1s->flags & H1S_F_REOS))
- se_fl_set(h1s->endp, CS_EP_EOS);
+ se_fl_set(h1s->endp, SE_FL_EOS);
if ((h1c->flags & H1C_F_ST_ERROR) || (conn->flags & CO_FL_ERROR))
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
h1_alert(h1s);
TRACE_DEVEL("waiting to release the CS before releasing the connection", H1_EV_H1C_WAKE);
}
@@ -3263,7 +3263,7 @@
if (h1c->flags & H1C_F_ST_ATTACHED) {
/* Don't release the H1 connection right now, we must destroy the
* attached CS first. Here, the H1C must not be READY */
- se_fl_set(h1c->h1s->endp, CS_EP_EOS | CS_EP_ERROR);
+ se_fl_set(h1c->h1s->endp, SE_FL_EOS | SE_FL_ERROR);
h1_alert(h1c->h1s);
h1_refresh_timeout(h1c);
HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].idle_conns_lock);
@@ -3475,9 +3475,9 @@
TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
- if (se_fl_test(h1s->endp, CS_EP_SHR))
+ if (se_fl_test(h1s->endp, SE_FL_SHR))
goto end;
- if (se_fl_test(h1s->endp, CS_EP_KILL_CONN)) {
+ if (se_fl_test(h1s->endp, SE_FL_KILL_CONN)) {
TRACE_STATE("stream wants to kill the connection", H1_EV_STRM_SHUT, h1c->conn, h1s);
goto do_shutr;
}
@@ -3498,7 +3498,7 @@
do_shutr:
/* NOTE: Be sure to handle abort (cf. h2_shutr) */
- if (se_fl_test(h1s->endp, CS_EP_SHR))
+ if (se_fl_test(h1s->endp, SE_FL_SHR))
goto end;
if (conn_xprt_ready(h1c->conn) && h1c->conn->xprt->shutr)
@@ -3518,9 +3518,9 @@
TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
- if (se_fl_test(h1s->endp, CS_EP_SHW))
+ if (se_fl_test(h1s->endp, SE_FL_SHW))
goto end;
- if (se_fl_test(h1s->endp, CS_EP_KILL_CONN)) {
+ if (se_fl_test(h1s->endp, SE_FL_KILL_CONN)) {
TRACE_STATE("stream wants to kill the connection", H1_EV_STRM_SHUT, h1c->conn, h1s);
goto do_shutw;
}
@@ -3664,7 +3664,7 @@
else
TRACE_DEVEL("h1c ibuf not allocated", H1_EV_H1C_RECV|H1_EV_H1C_BLK, h1c->conn);
- if ((flags & CO_RFL_BUF_FLUSH) && se_fl_test(h1s->endp, CS_EP_MAY_SPLICE)) {
+ if ((flags & CO_RFL_BUF_FLUSH) && se_fl_test(h1s->endp, SE_FL_MAY_SPLICE)) {
h1c->flags |= H1C_F_WANT_SPLICE;
TRACE_STATE("Block xprt rcv_buf to flush stream's buffer (want_splice)", H1_EV_STRM_RECV, h1c->conn, h1s);
}
@@ -3702,7 +3702,7 @@
}
if (h1c->flags & H1C_F_ST_ERROR) {
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
TRACE_ERROR("H1C on error, leaving in error", H1_EV_STRM_SEND|H1_EV_H1C_ERR|H1_EV_H1S_ERR|H1_EV_STRM_ERR, h1c->conn, h1s);
return 0;
}
@@ -3734,7 +3734,7 @@
}
if (h1c->flags & H1C_F_ST_ERROR) {
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
TRACE_ERROR("reporting error to the app-layer stream", H1_EV_STRM_SEND|H1_EV_H1S_ERR|H1_EV_STRM_ERR, h1c->conn, h1s);
}
@@ -3779,7 +3779,7 @@
if (ret > h1m->curr_len) {
h1s->flags |= H1S_F_PARSING_ERROR;
h1c->flags |= H1C_F_ST_ERROR;
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
TRACE_ERROR("too much payload, more than announced",
H1_EV_RX_DATA|H1_EV_STRM_ERR|H1_EV_H1C_ERR|H1_EV_H1S_ERR, h1c->conn, h1s);
goto end;
@@ -3804,7 +3804,7 @@
if (!(h1c->flags & H1C_F_WANT_SPLICE)) {
TRACE_STATE("notify the mux can't use splicing anymore", H1_EV_STRM_RECV, h1c->conn, h1s);
- se_fl_clr(h1s->endp, CS_EP_MAY_SPLICE);
+ se_fl_clr(h1s->endp, SE_FL_MAY_SPLICE);
if (!(h1c->wait_event.events & SUB_RETRY_RECV)) {
TRACE_STATE("restart receiving data, subscribing", H1_EV_STRM_RECV, h1c->conn, h1s);
h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
@@ -3837,7 +3837,7 @@
if (ret > h1m->curr_len) {
h1s->flags |= H1S_F_PROCESSING_ERROR;
h1c->flags |= H1C_F_ST_ERROR;
- se_fl_set(h1s->endp, CS_EP_ERROR);
+ se_fl_set(h1s->endp, SE_FL_ERROR);
TRACE_ERROR("too much payload, more than announced",
H1_EV_TX_DATA|H1_EV_STRM_ERR|H1_EV_H1C_ERR|H1_EV_H1S_ERR, h1c->conn, h1s);
goto end;
@@ -3910,7 +3910,7 @@
if (h1s->endp) {
chunk_appendf(msg, " .endp.flg=0x%08x",
se_fl_get(h1s->endp));
- if (!se_fl_test(h1s->endp, CS_EP_ORPHAN))
+ if (!se_fl_test(h1s->endp, SE_FL_ORPHAN))
chunk_appendf(msg, " .cs.flg=0x%08x .cs.app=%p",
h1s->endp->cs->flags, h1s->endp->cs->app);
}