CLEANUP: stconn: tree-wide rename stconn states CS_ST/SB_* to SC_ST/SB_*
This also follows the natural naming. There are roughly 238 changes, all
totally trivial. conn_stream-t.h has become completely void of any
"conn_stream" related stuff now (except its name).
diff --git a/src/backend.c b/src/backend.c
index dc20839..b1c33f6 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1294,7 +1294,7 @@
return ret;
/* we're in the process of establishing a connection */
- s->scb->state = CS_ST_CON;
+ s->scb->state = SC_ST_CON;
}
else {
/* try to reuse the existing connection, it will be
@@ -1302,9 +1302,9 @@
*/
/* Is the connection really ready ? */
if (conn->mux->ctl(conn, MUX_STATUS, NULL) & MUX_STATUS_READY)
- s->scb->state = CS_ST_RDY;
+ s->scb->state = SC_ST_RDY;
else
- s->scb->state = CS_ST_CON;
+ s->scb->state = SC_ST_CON;
}
/* needs src ip/port for logging */
@@ -1821,7 +1821,7 @@
}
/* Now handle synchronously connected sockets. We know the stream connector
- * is at least in state CS_ST_CON. These ones typically are UNIX
+ * is at least in state SC_ST_CON. These ones typically are UNIX
* sockets, socket pairs, andoccasionally TCP connections on the
* loopback on a heavily loaded system.
*/
@@ -1836,12 +1836,12 @@
if (!(srv_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)))
sc_ep_clr(s->scb, SE_FL_WAIT_FOR_HS);
- if (!cs_state_in(s->scb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO) &&
+ if (!cs_state_in(s->scb->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO) &&
(srv_conn->flags & CO_FL_WAIT_XPRT) == 0) {
s->conn_exp = TICK_ETERNITY;
cs_oc(s->scb)->flags |= CF_WRITE_NULL;
- if (s->scb->state == CS_ST_CON)
- s->scb->state = CS_ST_RDY;
+ if (s->scb->state == SC_ST_CON)
+ s->scb->state = SC_ST_RDY;
}
/* Report EOI on the channel if it was reached from the mux point of
@@ -1924,7 +1924,7 @@
case SRV_STATUS_QUEUED:
s->conn_exp = tick_add_ifset(now_ms, s->be->timeout.queue);
- s->scb->state = CS_ST_QUE;
+ s->scb->state = SC_ST_QUE;
/* do nothing else and do not wake any other stream up */
return 1;
@@ -1961,10 +1961,10 @@
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE))));
}
-/* Update back stream connector status for input states CS_ST_ASS, CS_ST_QUE,
- * CS_ST_TAR. Other input states are simply ignored.
- * Possible output states are CS_ST_CLO, CS_ST_TAR, CS_ST_ASS, CS_ST_REQ, CS_ST_CON
- * and CS_ST_EST. Flags must have previously been updated for timeouts and other
+/* Update back stream connector status for input states SC_ST_ASS, SC_ST_QUE,
+ * SC_ST_TAR. Other input states are simply ignored.
+ * Possible output states are SC_ST_CLO, SC_ST_TAR, SC_ST_ASS, SC_ST_REQ, SC_ST_CON
+ * and SC_ST_EST. Flags must have previously been updated for timeouts and other
* conditions.
*/
void back_try_conn_req(struct stream *s)
@@ -1975,7 +1975,7 @@
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
- if (cs->state == CS_ST_ASS) {
+ if (cs->state == SC_ST_ASS) {
/* Server assigned to connection request, we have to try to connect now */
int conn_err;
@@ -1992,7 +1992,7 @@
srv = objt_server(s->target);
if (conn_err == SF_ERR_NONE) {
- /* state = CS_ST_CON or CS_ST_EST now */
+ /* state = SC_ST_CON or SC_ST_EST now */
if (srv)
srv_inc_sess_ctr(srv);
if (srv)
@@ -2033,7 +2033,7 @@
pendconn_cond_unlink(s->pend_pos);
/* no stream was ever accounted for this server */
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
DBG_TRACE_STATE("internal error during connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
@@ -2044,14 +2044,14 @@
* turn-around now, as the problem is likely a source port
* allocation problem, so we want to retry now.
*/
- cs->state = CS_ST_CER;
+ cs->state = SC_ST_CER;
sc_ep_clr(cs, SE_FL_ERROR);
back_handle_st_cer(s);
DBG_TRACE_STATE("connection error, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
- /* now cs->state is one of CS_ST_CLO, CS_ST_TAR, CS_ST_ASS, CS_ST_REQ */
+ /* now cs->state is one of SC_ST_CLO, SC_ST_TAR, SC_ST_ASS, SC_ST_REQ */
}
- else if (cs->state == CS_ST_QUE) {
+ else if (cs->state == SC_ST_QUE) {
/* connection request was queued, check for any update */
if (!pendconn_dequeue(s)) {
/* The connection is not in the queue anymore. Either
@@ -2061,10 +2061,10 @@
*/
s->conn_exp = TICK_ETERNITY;
if (unlikely(!(s->flags & SF_ASSIGNED)))
- cs->state = CS_ST_REQ;
+ cs->state = SC_ST_REQ;
else {
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
- cs->state = CS_ST_ASS;
+ cs->state = SC_ST_ASS;
}
DBG_TRACE_STATE("dequeue connection request", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
goto end;
@@ -2088,7 +2088,7 @@
req->flags |= CF_WRITE_TIMEOUT;
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_QUEUE_TO;
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
DBG_TRACE_STATE("connection request still queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@@ -2109,7 +2109,7 @@
/* Nothing changed */
}
- else if (cs->state == CS_ST_TAR) {
+ else if (cs->state == SC_ST_TAR) {
/* Connection request might be aborted */
if (back_may_abort_req(req, s)) {
s->conn_err_type |= STRM_ET_CONN_ABRT;
@@ -2128,9 +2128,9 @@
* FIXME: Should we force a redispatch attempt when the server is down ?
*/
if (s->flags & SF_ASSIGNED)
- cs->state = CS_ST_ASS;
+ cs->state = SC_ST_ASS;
else
- cs->state = CS_ST_REQ;
+ cs->state = SC_ST_REQ;
DBG_TRACE_STATE("retry connection now", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
@@ -2145,7 +2145,7 @@
s->flags &= ~SF_CONN_EXP;
cs_shutr(cs);
cs_shutw(cs);
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
DBG_TRACE_DEVEL("leaving on error", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
@@ -2153,16 +2153,16 @@
}
/* This function initiates a server connection request on a stream connector
- * already in CS_ST_REQ state. Upon success, the state goes to CS_ST_ASS for
+ * already in SC_ST_REQ state. Upon success, the state goes to SC_ST_ASS for
* a real connection to a server, indicating that a server has been assigned,
- * or CS_ST_RDY for a successful connection to an applet. It may also return
- * CS_ST_QUE, or CS_ST_CLO upon error.
+ * or SC_ST_RDY for a successful connection to an applet. It may also return
+ * SC_ST_QUE, or SC_ST_CLO upon error.
*/
void back_handle_st_req(struct stream *s)
{
struct stconn *cs = s->scb;
- if (cs->state != CS_ST_REQ)
+ if (cs->state != SC_ST_REQ)
return;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@@ -2170,9 +2170,9 @@
if (unlikely(obj_type(s->target) == OBJ_TYPE_APPLET)) {
struct appctx *appctx;
- /* The target is an applet but the CS is in CS_ST_REQ. Thus it
+ /* The target is an applet but the CS is in SC_ST_REQ. Thus it
* means no appctx are attached to the CS. Otherwise, it will be
- * in CS_ST_RDY state. So, try to create the appctx now.
+ * in SC_ST_RDY state. So, try to create the appctx now.
*/
BUG_ON(cs_appctx(cs));
appctx = cs_applet_create(cs, objt_applet(s->target));
@@ -2187,7 +2187,7 @@
cs_shutw(cs);
s->req.flags |= CF_WRITE_ERROR;
s->conn_err_type = STRM_ET_CONN_RES;
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
DBG_TRACE_STATE("failed to register applet", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
@@ -2203,7 +2203,7 @@
/* We did not get a server. Either we queued the
* connection request, or we encountered an error.
*/
- if (cs->state == CS_ST_QUE) {
+ if (cs->state == SC_ST_QUE) {
DBG_TRACE_STATE("connection request queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
goto end;
}
@@ -2214,7 +2214,7 @@
s->req.flags |= CF_WRITE_ERROR;
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_OTHER;
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
DBG_TRACE_STATE("connection request failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
@@ -2223,7 +2223,7 @@
/* The server is assigned */
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
- cs->state = CS_ST_ASS;
+ cs->state = SC_ST_ASS;
be_set_sess_last(s->be);
DBG_TRACE_STATE("connection request assigned to a server", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@@ -2231,10 +2231,10 @@
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
-/* This function is called with (cs->state == CS_ST_CON) meaning that a
+/* This function is called with (cs->state == SC_ST_CON) meaning that a
* connection was attempted and that the file descriptor is already allocated.
* We must check for timeout, error and abort. Possible output states are
- * CS_ST_CER (error), CS_ST_DIS (abort), and CS_ST_CON (no change). This only
+ * SC_ST_CER (error), SC_ST_DIS (abort), and SC_ST_CON (no change). This only
* works with connection-based streams. We know that there were no I/O event
* when reaching this function. Timeouts and errors are *not* cleared.
*/
@@ -2255,7 +2255,7 @@
s->conn_err_type |= STRM_ET_CONN_ABRT;
if (s->srv_error)
s->srv_error(s, cs);
- /* Note: state = CS_ST_DIS now */
+ /* Note: state = SC_ST_DIS now */
DBG_TRACE_STATE("client abort during connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
}
@@ -2270,7 +2270,7 @@
s->conn_err_type = STRM_ET_CONN_TO;
}
- cs->state = CS_ST_CER;
+ cs->state = SC_ST_CER;
DBG_TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
}
@@ -2278,13 +2278,13 @@
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
-/* This function is called with (cs->state == CS_ST_CER) meaning that a
+/* This function is called with (cs->state == SC_ST_CER) meaning that a
* previous connection attempt has failed and that the file descriptor
* has already been released. Possible causes include asynchronous error
- * notification and time out. Possible output states are CS_ST_CLO when
- * retries are exhausted, CS_ST_TAR when a delay is wanted before a new
- * connection attempt, CS_ST_ASS when it's wise to retry on the same server,
- * and CS_ST_REQ when an immediate redispatch is wanted. The buffers are
+ * notification and time out. Possible output states are SC_ST_CLO when
+ * retries are exhausted, SC_ST_TAR when a delay is wanted before a new
+ * connection attempt, SC_ST_ASS when it's wise to retry on the same server,
+ * and SC_ST_REQ when an immediate redispatch is wanted. The buffers are
* marked as in error state. Timeouts and errors are cleared before retrying.
*/
void back_handle_st_cer(struct stream *s)
@@ -2351,7 +2351,7 @@
s->req.flags |= CF_WRITE_ERROR;
s->res.flags |= CF_READ_ERROR;
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
@@ -2385,7 +2385,7 @@
s->req.flags |= CF_WRITE_ERROR;
s->res.flags |= CF_READ_ERROR;
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, cs);
@@ -2415,10 +2415,10 @@
s->conn_err_type = STRM_ET_CONN_ERR;
/* only wait when we're retrying on the same server */
- if ((cs->state == CS_ST_ASS ||
+ if ((cs->state == SC_ST_ASS ||
(s->be->lbprm.algo & BE_LB_KIND) != BE_LB_KIND_RR ||
(s->be->srv_act <= 1)) && !reused) {
- cs->state = CS_ST_TAR;
+ cs->state = SC_ST_TAR;
s->conn_exp = tick_add(now_ms, MS_TO_TICKS(delay));
}
DBG_TRACE_STATE("retry a new connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@@ -2428,11 +2428,11 @@
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
-/* This function is called with (cs->state == CS_ST_RDY) meaning that a
+/* This function is called with (cs->state == SC_ST_RDY) meaning that a
* connection was attempted, that the file descriptor is already allocated,
* and that it has succeeded. We must still check for errors and aborts.
- * Possible output states are CS_ST_EST (established), CS_ST_CER (error),
- * and CS_ST_DIS (abort). This only works with connection-based streams.
+ * Possible output states are SC_ST_EST (established), SC_ST_CER (error),
+ * and SC_ST_DIS (abort). This only works with connection-based streams.
* Timeouts and errors are *not* cleared.
*/
void back_handle_st_rdy(struct stream *s)
@@ -2445,7 +2445,7 @@
if (unlikely(obj_type(s->target) == OBJ_TYPE_APPLET)) {
/* Here the appctx must exists because the CS was set to
- * CS_ST_RDY state when the appctx was created.
+ * SC_ST_RDY state when the appctx was created.
*/
BUG_ON(!cs_appctx(s->scb));
@@ -2463,7 +2463,7 @@
* - an I/O error might have been reported after a successful transfer,
* which is not retryable and needs to be logged correctly, and needs
* established as well
- * - CS_ST_CON implies !CF_WROTE_DATA but not conversely as we could
+ * - SC_ST_CON implies !CF_WROTE_DATA but not conversely as we could
* have validated a connection with incoming data (e.g. TCP with a
* banner protocol), or just a successful connect() probe.
* - the client might have requested a connection abort, this needs to
@@ -2492,7 +2492,7 @@
if (sc_ep_test(cs, SE_FL_ERROR)) {
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_ERR;
- cs->state = CS_ST_CER;
+ cs->state = SC_ST_CER;
DBG_TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
}
@@ -2503,7 +2503,7 @@
*/
DBG_TRACE_STATE("connection established", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
s->conn_err_type = STRM_ET_NONE;
- cs->state = CS_ST_EST;
+ cs->state = SC_ST_EST;
end:
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
diff --git a/src/cache.c b/src/cache.c
index 8b523f2..8a79ef0 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1466,7 +1466,7 @@
res_htx = htx_from_buf(&res->buf);
total = res_htx->data;
- if (unlikely(cs->state == CS_ST_DIS || cs->state == CS_ST_CLO))
+ if (unlikely(cs->state == SC_ST_DIS || cs->state == SC_ST_CLO))
goto out;
/* Check if the input buffer is available. */
diff --git a/src/cli.c b/src/cli.c
index dc7d79c..273fe86 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -904,7 +904,7 @@
int reql;
int len;
- if (unlikely(cs->state == CS_ST_DIS || cs->state == CS_ST_CLO))
+ if (unlikely(cs->state == SC_ST_DIS || cs->state == SC_ST_CLO))
goto out;
/* Check if the input buffer is available. */
@@ -1170,7 +1170,7 @@
}
}
- if ((res->flags & CF_SHUTR) && (cs->state == CS_ST_EST)) {
+ if ((res->flags & CF_SHUTR) && (cs->state == SC_ST_EST)) {
DPRINTF(stderr, "%s@%d: cs to buf closed. req=%08x, res=%08x, st=%d\n",
__FUNCTION__, __LINE__, req->flags, res->flags, cs->state);
/* Other side has closed, let's abort if we have no more processing to do
@@ -1181,7 +1181,7 @@
cs_shutw(cs);
}
- if ((req->flags & CF_SHUTW) && (cs->state == CS_ST_EST) && (appctx->st0 < CLI_ST_OUTPUT)) {
+ if ((req->flags & CF_SHUTW) && (cs->state == SC_ST_EST) && (appctx->st0 < CLI_ST_OUTPUT)) {
DPRINTF(stderr, "%s@%d: buf to cs closed. req=%08x, res=%08x, st=%d\n",
__FUNCTION__, __LINE__, req->flags, res->flags, cs->state);
/* We have no more processing to do, and nothing more to send, and
@@ -2787,7 +2787,7 @@
sockaddr_free(&s->scb->dst);
- cs_set_state(s->scb, CS_ST_INI);
+ cs_set_state(s->scb, SC_ST_INI);
s->scb->flags &= SC_FL_ISBACK | SC_FL_DONT_WAKE; /* we're in the context of process_stream */
s->req.flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WROTE_DATA);
s->res.flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_WROTE_DATA|CF_READ_NULL);
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 655bcc9..e9c8b15 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -127,7 +127,7 @@
cs->obj_type = OBJ_TYPE_CS;
cs->flags = SC_FL_NONE;
- cs->state = CS_ST_INI;
+ cs->state = SC_ST_INI;
cs->hcto = TICK_ETERNITY;
cs->app = NULL;
cs->data_cb = NULL;
@@ -493,7 +493,7 @@
cs_cant_get(cs);
appctx_wakeup(appctx);
- cs->state = CS_ST_RDY;
+ cs->state = SC_ST_RDY;
return appctx;
}
@@ -514,11 +514,11 @@
ic->flags |= CF_SHUTR;
ic->rex = TICK_ETERNITY;
- if (!cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST))
+ if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
if (cs_oc(cs)->flags & CF_SHUTW) {
- cs->state = CS_ST_DIS;
+ cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
}
else if (cs->flags & SC_FL_NOHALF) {
@@ -556,8 +556,8 @@
}
switch (cs->state) {
- case CS_ST_RDY:
- case CS_ST_EST:
+ case SC_ST_RDY:
+ case SC_ST_EST:
/* we have to shut before closing, otherwise some short messages
* may never leave the system, especially when there are remaining
* unread data in the socket input buffer, or when nolinger is set.
@@ -569,12 +569,12 @@
return;
/* fall through */
- case CS_ST_CON:
- case CS_ST_CER:
- case CS_ST_QUE:
- case CS_ST_TAR:
+ case SC_ST_CON:
+ case SC_ST_CER:
+ case SC_ST_QUE:
+ case SC_ST_TAR:
/* Note that none of these states may happen with applets */
- cs->state = CS_ST_DIS;
+ cs->state = SC_ST_DIS;
/* fall through */
default:
cs->flags &= ~SC_FL_NOLINGER;
@@ -618,7 +618,7 @@
__FUNCTION__,
cs, cs->state, cs_ic(cs)->flags, oc->flags);
- if (unlikely(cs->state != CS_ST_EST || (oc->flags & CF_SHUTW)))
+ if (unlikely(cs->state != SC_ST_EST || (oc->flags & CF_SHUTW)))
return;
if (!sc_ep_test(cs, SE_FL_WAIT_DATA) || /* not waiting for data */
@@ -658,12 +658,12 @@
ic->flags |= CF_SHUTR;
ic->rex = TICK_ETERNITY;
- if (!cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST))
+ if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
if (cs_oc(cs)->flags & CF_SHUTW) {
cs_conn_shut(cs);
- cs->state = CS_ST_DIS;
+ cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
}
else if (cs->flags & SC_FL_NOHALF) {
@@ -700,8 +700,8 @@
}
switch (cs->state) {
- case CS_ST_RDY:
- case CS_ST_EST:
+ case SC_ST_RDY:
+ case SC_ST_EST:
/* we have to shut before closing, otherwise some short messages
* may never leave the system, especially when there are remaining
* unread data in the socket input buffer, or when nolinger is set.
@@ -734,16 +734,16 @@
}
/* fall through */
- case CS_ST_CON:
+ case SC_ST_CON:
/* we may have to close a pending connection, and mark the
* response buffer as shutr
*/
cs_conn_shut(cs);
/* fall through */
- case CS_ST_CER:
- case CS_ST_QUE:
- case CS_ST_TAR:
- cs->state = CS_ST_DIS;
+ case SC_ST_CER:
+ case SC_ST_QUE:
+ case SC_ST_TAR:
+ cs->state = SC_ST_DIS;
/* fall through */
default:
cs->flags &= ~SC_FL_NOLINGER;
@@ -765,7 +765,7 @@
BUG_ON(!cs_conn(cs));
/* (re)start reading */
- if (cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST))
+ if (cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
tasklet_wakeup(cs->wait_event.tasklet);
}
@@ -781,7 +781,7 @@
BUG_ON(!cs_conn(cs));
- if (unlikely(!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST) ||
+ if (unlikely(!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST) ||
(oc->flags & CF_SHUTW)))
return;
@@ -797,7 +797,7 @@
if (sc_ep_test(cs, SE_FL_ERROR | SE_FL_ERR_PENDING) || cs_is_conn_error(cs)) {
/* Write error on the file descriptor */
- if (cs->state >= CS_ST_CON)
+ if (cs->state >= SC_ST_CON)
sc_ep_set(cs, SE_FL_ERROR);
goto out_wakeup;
}
@@ -813,7 +813,7 @@
*/
if (((oc->flags & (CF_SHUTW|CF_AUTO_CLOSE|CF_SHUTW_NOW)) ==
(CF_AUTO_CLOSE|CF_SHUTW_NOW)) &&
- cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST)) {
+ cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST)) {
cs_shutw(cs);
goto out_wakeup;
}
@@ -858,7 +858,7 @@
if (likely((oc->flags & (CF_WRITE_NULL|CF_WRITE_ERROR|CF_SHUTW)) ||
((oc->flags & CF_WAKE_WRITE) &&
((channel_is_empty(oc) && !oc->to_forward) ||
- !cs_state_in(cs->state, CS_SB_EST))))) {
+ !cs_state_in(cs->state, SC_SB_EST))))) {
out_wakeup:
if (!(cs->flags & SC_FL_DONT_WAKE))
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
@@ -887,12 +887,12 @@
/* Note: on shutr, we don't call the applet */
- if (!cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST))
+ if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
if (cs_oc(cs)->flags & CF_SHUTW) {
appctx_shut(__cs_appctx(cs));
- cs->state = CS_ST_DIS;
+ cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
}
else if (cs->flags & SC_FL_NOHALF) {
@@ -931,8 +931,8 @@
appctx_wakeup(__cs_appctx(cs));
switch (cs->state) {
- case CS_ST_RDY:
- case CS_ST_EST:
+ case SC_ST_RDY:
+ case SC_ST_EST:
/* we have to shut before closing, otherwise some short messages
* may never leave the system, especially when there are remaining
* unread data in the socket input buffer, or when nolinger is set.
@@ -944,13 +944,13 @@
return;
/* fall through */
- case CS_ST_CON:
- case CS_ST_CER:
- case CS_ST_QUE:
- case CS_ST_TAR:
+ case SC_ST_CON:
+ case SC_ST_CER:
+ case SC_ST_QUE:
+ case SC_ST_TAR:
/* Note that none of these states may happen with applets */
appctx_shut(__cs_appctx(cs));
- cs->state = CS_ST_DIS;
+ cs->state = SC_ST_DIS;
/* fall through */
default:
cs->flags &= ~SC_FL_NOLINGER;
@@ -989,7 +989,7 @@
__FUNCTION__,
cs, cs->state, cs_ic(cs)->flags, oc->flags);
- if (unlikely(cs->state != CS_ST_EST || (oc->flags & CF_SHUTW)))
+ if (unlikely(cs->state != SC_ST_EST || (oc->flags & CF_SHUTW)))
return;
/* we only wake the applet up if it was waiting for some data */
@@ -1121,7 +1121,7 @@
struct connection *conn = cs_conn(cs);
if (((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW) &&
- (cs->state == CS_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
+ (cs->state == SC_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
cs_shutw(cs);
oc->wex = TICK_ETERNITY;
}
@@ -1202,10 +1202,10 @@
/* wake the task up only when needed */
if (/* changes on the production side */
(ic->flags & (CF_READ_NULL|CF_READ_ERROR)) ||
- !cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST) ||
+ !cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST) ||
sc_ep_test(cs, SE_FL_ERROR) ||
((ic->flags & CF_READ_PARTIAL) &&
- ((ic->flags & CF_EOI) || !ic->to_forward || cso->state != CS_ST_EST)) ||
+ ((ic->flags & CF_EOI) || !ic->to_forward || cso->state != SC_ST_EST)) ||
/* changes on the consumption side */
(oc->flags & (CF_WRITE_NULL|CF_WRITE_ERROR)) ||
@@ -1213,7 +1213,7 @@
((oc->flags & CF_SHUTW) ||
(((oc->flags & CF_WAKE_WRITE) ||
!(oc->flags & (CF_AUTO_CLOSE|CF_SHUTW_NOW|CF_SHUTW))) &&
- (cso->state != CS_ST_EST ||
+ (cso->state != SC_ST_EST ||
(channel_is_empty(oc) && !oc->to_forward)))))) {
task_wakeup(task, TASK_WOKEN_IO);
}
@@ -1251,7 +1251,7 @@
ic->flags |= CF_SHUTR;
ic->rex = TICK_ETERNITY;
- if (!cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST))
+ if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
if (oc->flags & CF_SHUTW)
@@ -1277,7 +1277,7 @@
cs_done_get(cs);
- cs->state = CS_ST_DIS;
+ cs->state = SC_ST_DIS;
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
return;
}
@@ -1296,7 +1296,7 @@
int flags = 0;
/* If not established yet, do nothing. */
- if (cs->state != CS_ST_EST)
+ if (cs->state != SC_ST_EST)
return 0;
/* If another call to cs_conn_recv() failed, and we subscribed to
@@ -1620,7 +1620,7 @@
*/
int cs_conn_sync_recv(struct stconn *cs)
{
- if (!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST))
+ if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST))
return 0;
if (!cs_conn_mux(cs))
@@ -1652,11 +1652,11 @@
if (sc_ep_test(cs, SE_FL_ERROR | SE_FL_ERR_PENDING) || cs_is_conn_error(cs)) {
/* We're probably there because the tasklet was woken up,
* but process_stream() ran before, detected there were an
- * error and put the CS back to CS_ST_TAR. There's still
+ * error and put the CS back to SC_ST_TAR. There's still
* CO_FL_ERROR on the connection but we don't want to add
* SE_FL_ERROR back, so give up
*/
- if (cs->state < CS_ST_CON)
+ if (cs->state < SC_ST_CON)
return 0;
sc_ep_set(cs, SE_FL_ERROR);
return 1;
@@ -1765,8 +1765,8 @@
end:
if (did_send) {
oc->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA;
- if (cs->state == CS_ST_CON)
- cs->state = CS_ST_RDY;
+ if (cs->state == SC_ST_CON)
+ cs->state = SC_ST_RDY;
cs_rx_room_rdy(cs_opposite(cs));
}
@@ -1798,7 +1798,7 @@
if (channel_is_empty(oc))
return;
- if (!cs_state_in(cs->state, CS_SB_CON|CS_SB_RDY|CS_SB_EST))
+ if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
return;
if (!cs_conn_mux(cs))
@@ -1838,7 +1838,7 @@
* care of it.
*/
- if (cs->state >= CS_ST_CON) {
+ if (cs->state >= SC_ST_CON) {
if (cs_is_conn_error(cs))
sc_ep_set(cs, SE_FL_ERROR);
}
@@ -1854,12 +1854,12 @@
task_wakeup(cs_strm_task(cs), TASK_WOKEN_MSG);
}
- if (!cs_state_in(cs->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO) &&
+ if (!cs_state_in(cs->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO) &&
(conn->flags & CO_FL_WAIT_XPRT) == 0) {
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
oc->flags |= CF_WRITE_NULL;
- if (cs->state == CS_ST_CON)
- cs->state = CS_ST_RDY;
+ if (cs->state == SC_ST_CON)
+ cs->state = SC_ST_RDY;
}
/* Report EOS on the channel if it was reached from the mux point of
diff --git a/src/dns.c b/src/dns.c
index cf61d17..713008e 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -471,7 +471,7 @@
/* if the connection is not established, inform the stream that we want
* to be notified whenever the connection completes.
*/
- if (cs_opposite(cs)->state < CS_ST_EST) {
+ if (cs_opposite(cs)->state < SC_ST_EST) {
cs_cant_get(cs);
cs_rx_conn_blk(cs);
cs_rx_endp_more(cs);
@@ -506,7 +506,7 @@
* the message so that we can take our reference there if we have to
* stop before the end (ret=0).
*/
- if (cs_opposite(cs)->state == CS_ST_EST) {
+ if (cs_opposite(cs)->state == SC_ST_EST) {
/* we were already there, adjust the offset to be relative to
* the buffer's head and remove us from the counter.
*/
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index c96341d..c745e19 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1390,13 +1390,13 @@
char *frame, *buf;
int ret;
- if (cs_state_in(cs->state, CS_SB_CER|CS_SB_DIS|CS_SB_CLO)) {
+ if (cs_state_in(cs->state, SC_SB_CER|SC_SB_DIS|SC_SB_CLO)) {
/* closed */
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
goto exit;
}
- if (!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST)) {
+ if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST)) {
/* not connected yet */
cs_rx_endp_more(cs);
task_wakeup(__cs_strm(cs)->task, TASK_WOKEN_MSG);
@@ -1457,7 +1457,7 @@
int ret;
- if (cs->state == CS_ST_CLO || cs_opposite(cs)->state == CS_ST_CLO) {
+ if (cs->state == SC_ST_CLO || cs_opposite(cs)->state == SC_ST_CLO) {
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
goto exit;
}
@@ -1709,7 +1709,7 @@
struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent;
int ret, skip_sending = 0, skip_receiving = 0, active_s = 0, active_r = 0, close_asap = 0;
- if (cs->state == CS_ST_CLO || cs_opposite(cs)->state == CS_ST_CLO) {
+ if (cs->state == SC_ST_CLO || cs_opposite(cs)->state == SC_ST_CLO) {
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
goto exit;
}
@@ -1832,7 +1832,7 @@
char *frame, *buf;
int ret;
- if (cs->state == CS_ST_CLO || cs_opposite(cs)->state == CS_ST_CLO)
+ if (cs->state == SC_ST_CLO || cs_opposite(cs)->state == SC_ST_CLO)
goto exit;
if (appctx->st1 == SPOE_APPCTX_ERR_TOUT)
@@ -1884,7 +1884,7 @@
char *frame;
int ret;
- if (cs->state == CS_ST_CLO || cs_opposite(cs)->state == CS_ST_CLO) {
+ if (cs->state == SC_ST_CLO || cs_opposite(cs)->state == SC_ST_CLO) {
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
goto exit;
}
diff --git a/src/hlua.c b/src/hlua.c
index 4cda825..97da931 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -1955,7 +1955,7 @@
/* if the connection is not established, inform the stream that we want
* to be notified whenever the connection completes.
*/
- if (cs_opposite(cs)->state < CS_ST_EST) {
+ if (cs_opposite(cs)->state < SC_ST_EST) {
cs_cant_get(cs);
cs_rx_conn_blk(cs);
cs_rx_endp_more(cs);
@@ -2000,7 +2000,7 @@
* and retrieve data from the server. The connection is initialized
* with the "struct server".
*/
- cs_set_state(s->scb, CS_ST_ASS);
+ cs_set_state(s->scb, SC_ST_ASS);
/* Force destination server. */
s->flags |= SF_DIRECT | SF_ASSIGNED | SF_BE_ASSIGNED;
@@ -9329,7 +9329,7 @@
}
/* If the stream is disconnect or closed, ldo nothing. */
- if (unlikely(cs->state == CS_ST_DIS || cs->state == CS_ST_CLO))
+ if (unlikely(cs->state == SC_ST_DIS || cs->state == SC_ST_CLO))
return;
/* Execute the function. */
@@ -9522,7 +9522,7 @@
res_htx = htx_from_buf(&res->buf);
/* If the stream is disconnect or closed, ldo nothing. */
- if (unlikely(cs->state == CS_ST_DIS || cs->state == CS_ST_CLO))
+ if (unlikely(cs->state == SC_ST_DIS || cs->state == SC_ST_CLO))
goto out;
/* Check if the input buffer is available. */
@@ -10151,7 +10151,7 @@
fcn = ctx->fcn;
/* If the stream is disconnect or closed, ldo nothing. */
- if (unlikely(cs->state == CS_ST_DIS || cs->state == CS_ST_CLO))
+ if (unlikely(cs->state == SC_ST_DIS || cs->state == SC_ST_CLO))
return 1;
/* Execute the function. */
diff --git a/src/http_ana.c b/src/http_ana.c
index 66a36cb..308b7d6 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -4317,7 +4317,7 @@
cs_shutr(cs);
cs_shutw(cs);
s->conn_err_type = STRM_ET_NONE;
- cs->state = CS_ST_CLO;
+ cs->state = SC_ST_CLO;
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_LOCAL;
diff --git a/src/sink.c b/src/sink.c
index 804982a..2ff2a66 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -332,7 +332,7 @@
/* if the connection is not established, inform the stream that we want
* to be notified whenever the connection completes.
*/
- if (cs_opposite(cs)->state < CS_ST_EST) {
+ if (cs_opposite(cs)->state < SC_ST_EST) {
cs_cant_get(cs);
cs_rx_conn_blk(cs);
cs_rx_endp_more(cs);
@@ -371,7 +371,7 @@
* the message so that we can take our reference there if we have to
* stop before the end (ret=0).
*/
- if (cs_opposite(cs)->state == CS_ST_EST) {
+ if (cs_opposite(cs)->state == SC_ST_EST) {
/* we were already there, adjust the offset to be relative to
* the buffer's head and remove us from the counter.
*/
@@ -473,7 +473,7 @@
/* if the connection is not established, inform the stream that we want
* to be notified whenever the connection completes.
*/
- if (cs_opposite(cs)->state < CS_ST_EST) {
+ if (cs_opposite(cs)->state < SC_ST_EST) {
cs_cant_get(cs);
cs_rx_conn_blk(cs);
cs_rx_endp_more(cs);
@@ -512,7 +512,7 @@
* the message so that we can take our reference there if we have to
* stop before the end (ret=0).
*/
- if (cs_opposite(cs)->state == CS_ST_EST) {
+ if (cs_opposite(cs)->state == SC_ST_EST) {
/* we were already there, adjust the offset to be relative to
* the buffer's head and remove us from the counter.
*/
diff --git a/src/stats.c b/src/stats.c
index a4bdc69..9d012bf 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -4294,7 +4294,7 @@
res_htx = htx_from_buf(&res->buf);
- if (unlikely(cs->state == CS_ST_DIS || cs->state == CS_ST_CLO))
+ if (unlikely(cs->state == SC_ST_DIS || cs->state == SC_ST_CLO))
goto out;
/* Check if the input buffer is available. */
diff --git a/src/stream.c b/src/stream.c
index acfe494..99809ba 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -420,7 +420,7 @@
s->conn_retries = 0;
s->conn_exp = TICK_ETERNITY;
s->conn_err_type = STRM_ET_NONE;
- s->prev_conn_state = CS_ST_INI;
+ s->prev_conn_state = SC_ST_INI;
t->process = process_stream;
t->context = s;
t->expire = TICK_ETERNITY;
@@ -453,7 +453,7 @@
if (!s->scb)
goto out_fail_alloc_scb;
- cs_set_state(s->scf, CS_ST_EST);
+ cs_set_state(s->scf, SC_ST_EST);
s->scf->hcto = sess->fe->timeout.clientfin;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
@@ -860,13 +860,13 @@
}
/*
- * This function handles the transition between the CS_ST_CON state and the
- * CS_ST_EST state. It must only be called after switching from CS_ST_CON (or
- * CS_ST_INI or CS_ST_RDY) to CS_ST_EST, but only when a ->proto is defined.
- * Note that it will switch the interface to CS_ST_DIS if we already have
+ * This function handles the transition between the SC_ST_CON state and the
+ * SC_ST_EST state. It must only be called after switching from SC_ST_CON (or
+ * SC_ST_INI or SC_ST_RDY) to SC_ST_EST, but only when a ->proto is defined.
+ * Note that it will switch the interface to SC_ST_DIS if we already have
* the CF_SHUTR flag, it means we were able to forward the request, and
* receive the response, before process_stream() had the opportunity to
- * make the switch from CS_ST_CON to CS_ST_EST. When that happens, we want
+ * make the switch from SC_ST_CON to SC_ST_EST. When that happens, we want
* to go through back_establish() anyway, to make sure the analysers run.
* Timeouts are cleared. Error are reported on the channel so that analysers
* can handle them.
@@ -940,9 +940,9 @@
}
req->wex = TICK_ETERNITY;
/* If we managed to get the whole response, and we don't have anything
- * left to send, or can't, switch to CS_ST_DIS now. */
+ * left to send, or can't, switch to SC_ST_DIS now. */
if (rep->flags & (CF_SHUTR | CF_SHUTW)) {
- s->scb->state = CS_ST_DIS;
+ s->scb->state = SC_ST_DIS;
DBG_TRACE_STATE("response channel shutdwn for read/write", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
}
@@ -956,7 +956,7 @@
static void sess_set_term_flags(struct stream *s)
{
if (!(s->flags & SF_FINST_MASK)) {
- if (s->scb->state == CS_ST_INI) {
+ if (s->scb->state == SC_ST_INI) {
/* anything before REQ in fact */
_HA_ATOMIC_INC(&strm_fe(s)->fe_counters.failed_req);
if (strm_li(s) && strm_li(s)->counters)
@@ -964,11 +964,11 @@
s->flags |= SF_FINST_R;
}
- else if (s->scb->state == CS_ST_QUE)
+ else if (s->scb->state == SC_ST_QUE)
s->flags |= SF_FINST_Q;
- else if (cs_state_in(s->scb->state, CS_SB_REQ|CS_SB_TAR|CS_SB_ASS|CS_SB_CON|CS_SB_CER|CS_SB_RDY))
+ else if (cs_state_in(s->scb->state, SC_SB_REQ|SC_SB_TAR|SC_SB_ASS|SC_SB_CON|SC_SB_CER|SC_SB_RDY))
s->flags |= SF_FINST_C;
- else if (s->scb->state == CS_ST_EST || s->prev_conn_state == CS_ST_EST)
+ else if (s->scb->state == SC_ST_EST || s->prev_conn_state == SC_ST_EST)
s->flags |= SF_FINST_D;
else
s->flags |= SF_FINST_L;
@@ -1533,10 +1533,10 @@
s->prev_conn_state = scb->state;
/* let's recompute both sides states */
- if (cs_state_in(scf->state, CS_SB_RDY|CS_SB_EST))
+ if (cs_state_in(scf->state, SC_SB_RDY|SC_SB_EST))
cs_update(scf);
- if (cs_state_in(scb->state, CS_SB_RDY|CS_SB_EST))
+ if (cs_state_in(scb->state, SC_SB_RDY|SC_SB_EST))
cs_update(scb);
/* stream connectors are processed outside of process_stream() and must be
@@ -1755,7 +1755,7 @@
*/
srv = objt_server(s->target);
if (unlikely(sc_ep_test(scf, SE_FL_ERROR))) {
- if (cs_state_in(scf->state, CS_SB_EST|CS_SB_DIS)) {
+ if (cs_state_in(scf->state, SC_SB_EST|SC_SB_DIS)) {
cs_shutr(scf);
cs_shutw(scf);
cs_report_error(scf);
@@ -1775,7 +1775,7 @@
}
if (unlikely(sc_ep_test(scb, SE_FL_ERROR))) {
- if (cs_state_in(scb->state, CS_SB_EST|CS_SB_DIS)) {
+ if (cs_state_in(scb->state, SC_SB_EST|SC_SB_DIS)) {
cs_shutr(scb);
cs_shutw(scb);
cs_report_error(scb);
@@ -1798,23 +1798,23 @@
/* note: maybe we should process connection errors here ? */
}
- if (cs_state_in(scb->state, CS_SB_CON|CS_SB_RDY)) {
+ if (cs_state_in(scb->state, SC_SB_CON|SC_SB_RDY)) {
/* we were trying to establish a connection on the server side,
* maybe it succeeded, maybe it failed, maybe we timed out, ...
*/
- if (scb->state == CS_ST_RDY)
+ if (scb->state == SC_ST_RDY)
back_handle_st_rdy(s);
- else if (s->scb->state == CS_ST_CON)
+ else if (s->scb->state == SC_ST_CON)
back_handle_st_con(s);
- if (scb->state == CS_ST_CER)
+ if (scb->state == SC_ST_CER)
back_handle_st_cer(s);
- else if (scb->state == CS_ST_EST)
+ else if (scb->state == SC_ST_EST)
back_establish(s);
- /* state is now one of CS_ST_CON (still in progress), CS_ST_EST
- * (established), CS_ST_DIS (abort), CS_ST_CLO (last error),
- * CS_ST_ASS/CS_ST_TAR/CS_ST_REQ for retryable errors.
+ /* state is now one of SC_ST_CON (still in progress), SC_ST_EST
+ * (established), SC_ST_DIS (abort), SC_ST_CLO (last error),
+ * SC_ST_ASS/SC_ST_TAR/SC_ST_REQ for retryable errors.
*/
}
@@ -1827,8 +1827,8 @@
DBG_TRACE_POINT(STRM_EV_STRM_PROC, s);
/* nothing special to be done on client side */
- if (unlikely(scf->state == CS_ST_DIS)) {
- scf->state = CS_ST_CLO;
+ if (unlikely(scf->state == SC_ST_DIS)) {
+ scf->state = SC_ST_CLO;
/* This is needed only when debugging is enabled, to indicate
* client-side close.
@@ -1847,8 +1847,8 @@
/* When a server-side connection is released, we have to count it and
* check for pending connections on this server.
*/
- if (unlikely(scb->state == CS_ST_DIS)) {
- scb->state = CS_ST_CLO;
+ if (unlikely(scb->state == SC_ST_DIS)) {
+ scb->state = SC_ST_CLO;
srv = objt_server(s->target);
if (srv) {
if (s->flags & SF_CURR_SESS) {
@@ -1866,7 +1866,7 @@
if (unlikely((global.mode & MODE_DEBUG) &&
(!(global.mode & MODE_QUIET) ||
(global.mode & MODE_VERBOSE)))) {
- if (s->prev_conn_state == CS_ST_EST) {
+ if (s->prev_conn_state == SC_ST_EST) {
chunk_printf(&trash, "%08x:%s.srvcls[%04x:%04x]\n",
s->uniq_id, s->be->id,
(unsigned short)conn_fd(cs_conn(scf)),
@@ -1891,7 +1891,7 @@
s->pending_events & TASK_WOKEN_MSG) {
unsigned int flags = req->flags;
- if (cs_state_in(scf->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) {
+ if (cs_state_in(scf->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) {
int max_loops = global.tune.maxpollevents;
unsigned int ana_list;
unsigned int ana_back;
@@ -1992,7 +1992,7 @@
s->pending_events & TASK_WOKEN_MSG) {
unsigned int flags = res->flags;
- if (cs_state_in(scb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) {
+ if (cs_state_in(scb->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) {
int max_loops = global.tune.maxpollevents;
unsigned int ana_list;
unsigned int ana_back;
@@ -2105,11 +2105,11 @@
sess_set_term_flags(s);
/* Abort the request if a client error occurred while
- * the backend stream connector is in the CS_ST_INI
- * state. It is switched into the CS_ST_CLO state and
+ * the backend stream connector is in the SC_ST_INI
+ * state. It is switched into the SC_ST_CLO state and
* the request channel is erased. */
- if (scb->state == CS_ST_INI) {
- s->scb->state = CS_ST_CLO;
+ if (scb->state == SC_ST_INI) {
+ s->scb->state = SC_ST_CLO;
channel_abort(req);
if (IS_HTX_STRM(s))
channel_htx_erase(req, htxbuf(&req->buf));
@@ -2173,7 +2173,7 @@
*/
if (unlikely((!req->analysers || (req->analysers == AN_REQ_FLT_END && !(req->flags & CF_FLT_ANALYZE))) &&
!(req->flags & (CF_SHUTW|CF_SHUTR_NOW)) &&
- (cs_state_in(scf->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) &&
+ (cs_state_in(scf->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) &&
(req->to_forward != CHN_INFINITE_FORWARD))) {
/* This buffer is freewheeling, there's no analyser
* attached to it. If any data are left in, we'll permit them to
@@ -2226,14 +2226,14 @@
* - there are data scheduled for emission in the buffer
* - the CF_AUTO_CONNECT flag is set (active connection)
*/
- if (scb->state == CS_ST_INI) {
+ if (scb->state == SC_ST_INI) {
if (!(req->flags & CF_SHUTW)) {
if ((req->flags & CF_AUTO_CONNECT) || !channel_is_empty(req)) {
/* If we have an appctx, there is no connect method, so we
* immediately switch to the connected state, otherwise we
* perform a connection request.
*/
- scb->state = CS_ST_REQ; /* new connection requested */
+ scb->state = SC_ST_REQ; /* new connection requested */
s->conn_retries = 0;
if ((s->be->retry_type &~ PR_RE_CONN_FAILED) &&
(s->be->mode == PR_MODE_HTTP) &&
@@ -2242,7 +2242,7 @@
}
}
else {
- s->scb->state = CS_ST_CLO; /* shutw+ini = abort */
+ s->scb->state = SC_ST_CLO; /* shutw+ini = abort */
channel_shutw_now(req); /* fix buffer flags upon abort */
channel_shutr_now(res);
}
@@ -2252,7 +2252,7 @@
/* we may have a pending connection request, or a connection waiting
* for completion.
*/
- if (cs_state_in(scb->state, CS_SB_REQ|CS_SB_QUE|CS_SB_TAR|CS_SB_ASS)) {
+ if (cs_state_in(scb->state, SC_SB_REQ|SC_SB_QUE|SC_SB_TAR|SC_SB_ASS)) {
/* prune the request variables and swap to the response variables. */
if (s->vars_reqres.scope != SCOPE_RES) {
if (!LIST_ISEMPTY(&s->vars_reqres.head))
@@ -2264,26 +2264,26 @@
/* nb: step 1 might switch from QUE to ASS, but we first want
* to give a chance to step 2 to perform a redirect if needed.
*/
- if (scb->state != CS_ST_REQ)
+ if (scb->state != SC_ST_REQ)
back_try_conn_req(s);
- if (scb->state == CS_ST_REQ)
+ if (scb->state == SC_ST_REQ)
back_handle_st_req(s);
/* get a chance to complete an immediate connection setup */
- if (scb->state == CS_ST_RDY)
+ if (scb->state == SC_ST_RDY)
goto resync_stconns;
/* applets directly go to the ESTABLISHED state. Similarly,
* servers experience the same fate when their connection
* is reused.
*/
- if (unlikely(scb->state == CS_ST_EST))
+ if (unlikely(scb->state == SC_ST_EST))
back_establish(s);
srv = objt_server(s->target);
- if (scb->state == CS_ST_ASS && srv && srv->rdr_len && (s->flags & SF_REDIRECTABLE))
+ if (scb->state == SC_ST_ASS && srv && srv->rdr_len && (s->flags & SF_REDIRECTABLE))
http_perform_server_redirect(s, scb);
- } while (scb->state == CS_ST_ASS);
+ } while (scb->state == SC_ST_ASS);
}
/* Let's see if we can send the pending request now */
@@ -2301,7 +2301,7 @@
*/
if (unlikely((req->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CLOSE|CF_SHUTR)) ==
(CF_AUTO_CLOSE|CF_SHUTR) &&
- (scb->state != CS_ST_CON || (s->be->options & PR_O_ABRT_CLOSE)))) {
+ (scb->state != SC_ST_CON || (s->be->options & PR_O_ABRT_CLOSE)))) {
channel_shutw_now(req);
}
@@ -2326,10 +2326,10 @@
}
/* Benchmarks have shown that it's optimal to do a full resync now */
- if (scf->state == CS_ST_DIS ||
- cs_state_in(scb->state, CS_SB_RDY|CS_SB_DIS) ||
- (sc_ep_test(scf, SE_FL_ERROR) && scf->state != CS_ST_CLO) ||
- (sc_ep_test(scb, SE_FL_ERROR) && scb->state != CS_ST_CLO))
+ if (scf->state == SC_ST_DIS ||
+ cs_state_in(scb->state, SC_SB_RDY|SC_SB_DIS) ||
+ (sc_ep_test(scf, SE_FL_ERROR) && scf->state != SC_ST_CLO) ||
+ (sc_ep_test(scb, SE_FL_ERROR) && scb->state != SC_ST_CLO))
goto resync_stconns;
/* otherwise we want to check if we need to resync the req buffer or not */
@@ -2345,7 +2345,7 @@
*/
if (unlikely((!res->analysers || (res->analysers == AN_RES_FLT_END && !(res->flags & CF_FLT_ANALYZE))) &&
!(res->flags & (CF_SHUTW|CF_SHUTR_NOW)) &&
- cs_state_in(scb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO) &&
+ cs_state_in(scb->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO) &&
(res->to_forward != CHN_INFINITE_FORWARD))) {
/* This buffer is freewheeling, there's no analyser
* attached to it. If any data are left in, we'll permit them to
@@ -2450,10 +2450,10 @@
cs_shutr(scb);
}
- if (scf->state == CS_ST_DIS ||
- cs_state_in(scb->state, CS_SB_RDY|CS_SB_DIS) ||
- (sc_ep_test(scf, SE_FL_ERROR) && scf->state != CS_ST_CLO) ||
- (sc_ep_test(scb, SE_FL_ERROR) && scb->state != CS_ST_CLO))
+ if (scf->state == SC_ST_DIS ||
+ cs_state_in(scb->state, SC_SB_RDY|SC_SB_DIS) ||
+ (sc_ep_test(scf, SE_FL_ERROR) && scf->state != SC_ST_CLO) ||
+ (sc_ep_test(scb, SE_FL_ERROR) && scb->state != SC_ST_CLO))
goto resync_stconns;
if ((req->flags & ~rqf_last) & CF_MASK_ANALYSER)
@@ -2469,7 +2469,7 @@
scf->flags &= ~SC_FL_DONT_WAKE;
scb->flags &= ~SC_FL_DONT_WAKE;
- if (likely((scf->state != CS_ST_CLO) || !cs_state_in(scb->state, CS_SB_INI|CS_SB_CLO) ||
+ if (likely((scf->state != SC_ST_CLO) || !cs_state_in(scb->state, SC_SB_INI|SC_SB_CLO) ||
(req->analysers & AN_REQ_FLT_END) || (res->analysers & AN_RES_FLT_END))) {
if ((sess->fe->options & PR_O_CONTSTATS) && (s->flags & SF_BE_ASSIGNED) && !(s->flags & SF_IGNORE))
stream_process_counters(s);