void http_check_request_for_cacheability(struct stream *s, struct channel *req);
void http_check_response_for_cacheability(struct stream *s, struct channel *res);
enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn, unsigned int time, unsigned int bytes);
-void http_perform_server_redirect(struct stream *s, struct stconn *cs);
-void http_server_error(struct stream *s, struct stconn *cs, int err, int finst, struct http_reply *msg);
+void http_perform_server_redirect(struct stream *s, struct stconn *sc);
+void http_server_error(struct stream *s, struct stconn *sc, int err, int finst, struct http_reply *msg);
void http_reply_and_close(struct stream *s, short status, struct http_reply *msg);
-void http_return_srv_error(struct stream *s, struct stconn *cs);
+void http_return_srv_error(struct stream *s, struct stconn *sc);
struct http_reply *http_error_message(struct stream *s);
int http_reply_to_htx(struct stream *s, struct htx *htx, struct http_reply *reply);
int http_reply_message(struct stream *s, struct http_reply *reply);
void (*do_log)(struct stream *s); /* the function to call in order to log (or NULL) */
void (*srv_error)(struct stream *s, /* the function to call upon unrecoverable server errors (or NULL) */
- struct stconn *cs);
+ struct stconn *sc);
int pcli_next_pid; /* next target PID to use for the CLI proxy */
int pcli_flags; /* flags for CLI proxy */
extern struct data_cb sess_conn_cb;
-struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer *input);
+struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer *input);
void stream_free(struct stream *s);
-int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input);
+int stream_upgrade_from_cs(struct stconn *sc, struct buffer *input);
int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_proto);
/* kill a stream and set the termination flags to <why> (one of SF_ERR_*) */
void stream_process_counters(struct stream *s);
void sess_change_server(struct stream *strm, struct server *newsrv);
struct task *process_stream(struct task *t, void *context, unsigned int state);
-void default_srv_error(struct stream *s, struct stconn *cs);
+void default_srv_error(struct stream *s, struct stconn *sc);
/* Update the stream's backend and server time stats */
void stream_update_time_stats(struct stream *s);
void back_try_conn_req(struct stream *s)
{
struct server *srv = objt_server(s->target);
- struct stconn *cs = s->scb;
+ struct stconn *sc = s->scb;
struct channel *req = &s->req;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
- if (cs->state == SC_ST_ASS) {
+ if (sc->state == SC_ST_ASS) {
/* Server assigned to connection request, we have to try to connect now */
int conn_err;
process_srv_queue(srv);
/* Failed and not retryable. */
- sc_shutr(cs);
- sc_shutw(cs);
+ sc_shutr(sc);
+ sc_shutw(sc);
req->flags |= CF_WRITE_ERROR;
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
pendconn_cond_unlink(s->pend_pos);
/* no stream was ever accounted for this server */
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("internal error during connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
}
* turn-around now, as the problem is likely a source port
* allocation problem, so we want to retry now.
*/
- cs->state = SC_ST_CER;
- sc_ep_clr(cs, SE_FL_ERROR);
+ sc->state = SC_ST_CER;
+ sc_ep_clr(sc, 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 SC_ST_CLO, SC_ST_TAR, SC_ST_ASS, SC_ST_REQ */
+ /* now sc->state is one of SC_ST_CLO, SC_ST_TAR, SC_ST_ASS, SC_ST_REQ */
}
- else if (cs->state == SC_ST_QUE) {
+ else if (sc->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
*/
s->conn_exp = TICK_ETERNITY;
if (unlikely(!(s->flags & SF_ASSIGNED)))
- cs->state = SC_ST_REQ;
+ sc->state = SC_ST_REQ;
else {
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
- cs->state = SC_ST_ASS;
+ sc->state = SC_ST_ASS;
}
DBG_TRACE_STATE("dequeue connection request", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
goto end;
if (srv)
_HA_ATOMIC_INC(&srv->counters.failed_conns);
_HA_ATOMIC_INC(&s->be->be_counters.failed_conns);
- sc_shutr(cs);
- sc_shutw(cs);
+ sc_shutr(sc);
+ sc_shutw(sc);
req->flags |= CF_WRITE_TIMEOUT;
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_QUEUE_TO;
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("connection request still queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
goto end;
}
/* Nothing changed */
}
- else if (cs->state == SC_ST_TAR) {
+ else if (sc->state == SC_ST_TAR) {
/* Connection request might be aborted */
if (back_may_abort_req(req, s)) {
s->conn_err_type |= STRM_ET_CONN_ABRT;
* FIXME: Should we force a redispatch attempt when the server is down ?
*/
if (s->flags & SF_ASSIGNED)
- cs->state = SC_ST_ASS;
+ sc->state = SC_ST_ASS;
else
- cs->state = SC_ST_REQ;
+ sc->state = SC_ST_REQ;
DBG_TRACE_STATE("retry connection now", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
/* give up */
s->conn_exp = TICK_ETERNITY;
s->flags &= ~SF_CONN_EXP;
- sc_shutr(cs);
- sc_shutw(cs);
- cs->state = SC_ST_CLO;
+ sc_shutr(sc);
+ sc_shutw(sc);
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_DEVEL("leaving on error", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
return;
}
*/
void back_handle_st_req(struct stream *s)
{
- struct stconn *cs = s->scb;
+ struct stconn *sc = s->scb;
- if (cs->state != SC_ST_REQ)
+ if (sc->state != SC_ST_REQ)
return;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
* means no appctx are attached to the CS. Otherwise, it will be
* in SC_ST_RDY state. So, try to create the appctx now.
*/
- BUG_ON(sc_appctx(cs));
- appctx = sc_applet_create(cs, objt_applet(s->target));
+ BUG_ON(sc_appctx(sc));
+ appctx = sc_applet_create(sc, objt_applet(s->target));
if (!appctx) {
/* No more memory, let's immediately abort. Force the
* error code to ignore the ERR_LOCAL which is not a
*/
s->flags &= ~(SF_ERR_MASK | SF_FINST_MASK);
- sc_shutr(cs);
- sc_shutw(cs);
+ sc_shutr(sc);
+ sc_shutw(sc);
s->req.flags |= CF_WRITE_ERROR;
s->conn_err_type = STRM_ET_CONN_RES;
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("failed to register applet", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
}
/* We did not get a server. Either we queued the
* connection request, or we encountered an error.
*/
- if (cs->state == SC_ST_QUE) {
+ if (sc->state == SC_ST_QUE) {
DBG_TRACE_STATE("connection request queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
goto end;
}
/* we did not get any server, let's check the cause */
- sc_shutr(cs);
- sc_shutw(cs);
+ sc_shutr(sc);
+ sc_shutw(sc);
s->req.flags |= CF_WRITE_ERROR;
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_OTHER;
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("connection request failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
}
/* The server is assigned */
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
- cs->state = SC_ST_ASS;
+ sc->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);
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
-/* This function is called with (cs->state == SC_ST_CON) meaning that a
+/* This function is called with (sc->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
* SC_ST_CER (error), SC_ST_DIS (abort), and SC_ST_CON (no change). This only
*/
void back_handle_st_con(struct stream *s)
{
- struct stconn *cs = s->scb;
+ struct stconn *sc = s->scb;
struct channel *req = &s->req;
struct channel *rep = &s->res;
if ((rep->flags & CF_SHUTW) ||
((req->flags & CF_SHUTW_NOW) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
- cs->flags |= SC_FL_NOLINGER;
- sc_shutw(cs);
+ sc->flags |= SC_FL_NOLINGER;
+ sc_shutw(sc);
s->conn_err_type |= STRM_ET_CONN_ABRT;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
/* 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;
done:
/* retryable error ? */
- if ((s->flags & SF_CONN_EXP) || sc_ep_test(cs, SE_FL_ERROR)) {
+ if ((s->flags & SF_CONN_EXP) || sc_ep_test(sc, SE_FL_ERROR)) {
if (!s->conn_err_type) {
- if (sc_ep_test(cs, SE_FL_ERROR))
+ if (sc_ep_test(sc, SE_FL_ERROR))
s->conn_err_type = STRM_ET_CONN_ERR;
else
s->conn_err_type = STRM_ET_CONN_TO;
}
- cs->state = SC_ST_CER;
+ sc->state = SC_ST_CER;
DBG_TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
}
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
-/* This function is called with (cs->state == SC_ST_CER) meaning that a
+/* This function is called with (sc->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 SC_ST_CLO when
*/
void back_handle_st_cer(struct stream *s)
{
- struct stconn *cs = s->scb;
- int must_tar = sc_ep_test(cs, SE_FL_ERROR);
+ struct stconn *sc = s->scb;
+ int must_tar = sc_ep_test(sc, SE_FL_ERROR);
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
/* we probably have to release last stream from the server */
if (objt_server(s->target)) {
- struct connection *conn = sc_conn(cs);
+ struct connection *conn = sc_conn(sc);
health_adjust(__objt_server(s->target), HANA_STATUS_L4_ERR);
_HA_ATOMIC_DEC(&__objt_server(s->target)->cur_sess);
}
- if (sc_ep_test(cs, SE_FL_ERROR) &&
+ if (sc_ep_test(sc, SE_FL_ERROR) &&
conn && conn->err_code == CO_ER_SSL_MISMATCH_SNI) {
/* We tried to connect to a server which is configured
* with "verify required" and which doesn't have the
process_srv_queue(objt_server(s->target));
/* shutw is enough to stop a connecting socket */
- sc_shutw(cs);
+ sc_shutw(sc);
s->req.flags |= CF_WRITE_ERROR;
s->res.flags |= CF_READ_ERROR;
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("connection failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
* Note: the stream connector will be switched to ST_REQ, ST_ASS or
* ST_TAR and SE_FL_ERROR and SF_CONN_EXP flags will be unset.
*/
- if (sc_reset_endp(cs) < 0) {
+ if (sc_reset_endp(sc) < 0) {
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_OTHER;
process_srv_queue(objt_server(s->target));
/* shutw is enough to stop a connecting socket */
- sc_shutw(cs);
+ sc_shutw(sc);
s->req.flags |= CF_WRITE_ERROR;
s->res.flags |= CF_READ_ERROR;
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("error resetting endpoint", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
s->conn_err_type = STRM_ET_CONN_ERR;
/* only wait when we're retrying on the same server */
- if ((cs->state == SC_ST_ASS ||
+ if ((sc->state == SC_ST_ASS ||
(s->be->lbprm.algo & BE_LB_KIND) != BE_LB_KIND_RR ||
(s->be->srv_act <= 1)) && !reused) {
- cs->state = SC_ST_TAR;
+ sc->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);
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
}
-/* This function is called with (cs->state == SC_ST_RDY) meaning that a
+/* This function is called with (sc->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 SC_ST_EST (established), SC_ST_CER (error),
*/
void back_handle_st_rdy(struct stream *s)
{
- struct stconn *cs = s->scb;
+ struct stconn *sc = s->scb;
struct channel *req = &s->req;
struct channel *rep = &s->res;
((req->flags & CF_SHUTW_NOW) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
/* give up */
- cs->flags |= SC_FL_NOLINGER;
- sc_shutw(cs);
+ sc->flags |= SC_FL_NOLINGER;
+ sc_shutw(sc);
s->conn_err_type |= STRM_ET_CONN_ABRT;
if (s->srv_error)
- s->srv_error(s, cs);
+ s->srv_error(s, sc);
DBG_TRACE_STATE("client abort during connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
goto end;
}
/* retryable error ? */
- if (sc_ep_test(cs, SE_FL_ERROR)) {
+ if (sc_ep_test(sc, SE_FL_ERROR)) {
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_ERR;
- cs->state = SC_ST_CER;
+ sc->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;
}
*/
DBG_TRACE_STATE("connection established", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
s->conn_err_type = STRM_ET_NONE;
- cs->state = SC_ST_EST;
+ sc->state = SC_ST_EST;
end:
DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
/* Reset the stream and the backend stream connector to a situation suitable for attemption connection */
/* Returns 0 if we can attempt to retry, -1 otherwise */
-static __inline int do_l7_retry(struct stream *s, struct stconn *cs)
+static __inline int do_l7_retry(struct stream *s, struct stconn *sc)
{
struct channel *req, *res;
int co_data;
goto end;
}
-void http_perform_server_redirect(struct stream *s, struct stconn *cs)
+void http_perform_server_redirect(struct stream *s, struct stconn *sc)
{
struct channel *req = &s->req;
struct channel *res = &s->res;
goto fail;
/* return without error. */
- sc_shutr(cs);
- sc_shutw(cs);
+ sc_shutr(sc);
+ sc_shutw(sc);
s->conn_err_type = STRM_ET_NONE;
- cs->state = SC_ST_CLO;
+ sc->state = SC_ST_CLO;
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_LOCAL;
return 1;
}
-void http_server_error(struct stream *s, struct stconn *cs, int err,
+void http_server_error(struct stream *s, struct stconn *sc, int err,
int finst, struct http_reply *msg)
{
http_reply_and_close(s, s->txn->status, msg);
* Note that connection errors appearing on the second request of a keep-alive
* connection are not reported since this allows the client to retry.
*/
-void http_return_srv_error(struct stream *s, struct stconn *cs)
+void http_return_srv_error(struct stream *s, struct stconn *sc)
{
int err_type = s->conn_err_type;
/* set s->txn->status for http_error_message(s) */
if (err_type & STRM_ET_QUEUE_ABRT) {
s->txn->status = -1;
- http_server_error(s, cs, SF_ERR_CLICL, SF_FINST_Q, NULL);
+ http_server_error(s, sc, SF_ERR_CLICL, SF_FINST_Q, NULL);
}
else if (err_type & STRM_ET_CONN_ABRT) {
s->txn->status = -1;
- http_server_error(s, cs, SF_ERR_CLICL, SF_FINST_C, NULL);
+ http_server_error(s, sc, SF_ERR_CLICL, SF_FINST_C, NULL);
}
else if (err_type & STRM_ET_QUEUE_TO) {
s->txn->status = 503;
- http_server_error(s, cs, SF_ERR_SRVTO, SF_FINST_Q,
+ http_server_error(s, sc, SF_ERR_SRVTO, SF_FINST_Q,
http_error_message(s));
}
else if (err_type & STRM_ET_QUEUE_ERR) {
s->txn->status = 503;
- http_server_error(s, cs, SF_ERR_SRVCL, SF_FINST_Q,
+ http_server_error(s, sc, SF_ERR_SRVCL, SF_FINST_Q,
http_error_message(s));
}
else if (err_type & STRM_ET_CONN_TO) {
s->txn->status = 503;
- http_server_error(s, cs, SF_ERR_SRVTO, SF_FINST_C,
+ http_server_error(s, sc, SF_ERR_SRVTO, SF_FINST_C,
(s->txn->flags & TX_NOT_FIRST) ? NULL :
http_error_message(s));
}
else if (err_type & STRM_ET_CONN_ERR) {
s->txn->status = 503;
- http_server_error(s, cs, SF_ERR_SRVCL, SF_FINST_C,
+ http_server_error(s, sc, SF_ERR_SRVCL, SF_FINST_C,
(s->flags & SF_SRV_REUSED) ? NULL :
http_error_message(s));
}
else if (err_type & STRM_ET_CONN_RES) {
s->txn->status = 503;
- http_server_error(s, cs, SF_ERR_RESOURCE, SF_FINST_C,
+ http_server_error(s, sc, SF_ERR_RESOURCE, SF_FINST_C,
(s->txn->flags & TX_NOT_FIRST) ? NULL :
http_error_message(s));
}
else { /* STRM_ET_CONN_OTHER and others */
s->txn->status = 500;
- http_server_error(s, cs, SF_ERR_INTERNAL, SF_FINST_C,
+ http_server_error(s, sc, SF_ERR_INTERNAL, SF_FINST_C,
http_error_message(s));
}
}
struct http_txn *http_create_txn(struct stream *s)
{
struct http_txn *txn;
- struct stconn *cs = s->scf;
+ struct stconn *sc = s->scf;
txn = pool_alloc(pool_head_http_txn);
if (!txn)
return NULL;
s->txn = txn;
- txn->flags = ((cs && sc_ep_test(cs, SE_FL_NOT_FIRST)) ? TX_NOT_FIRST : 0);
+ txn->flags = ((sc && sc_ep_test(sc, SE_FL_NOT_FIRST)) ? TX_NOT_FIRST : 0);
txn->status = -1;
txn->http_reply = NULL;
txn->l7_buffer = BUF_NULL;
/* The event representation is split like this :
* strm - stream
- * cs - stream connector
+ * sc - stream connector
* http - http analyzis
* tcp - tcp analyzis
*
}
}
-/* Upgrade an existing stream for stream connector <cs>. Return < 0 on error. This
+/* Upgrade an existing stream for stream connector <sc>. Return < 0 on error. This
* is only valid right after a TCP to H1 upgrade. The stream should be
* "reativated" by removing SF_IGNORE flag. And the right mode must be set. On
* success, <input> buffer is transferred to the stream and thus points to
* BUF_NULL. On error, it is unchanged and it is the caller responsibility to
* release it (this never happens for now).
*/
-int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input)
+int stream_upgrade_from_cs(struct stconn *sc, struct buffer *input)
{
- struct stream *s = __sc_strm(cs);
- const struct mux_ops *mux = sc_mux_ops(cs);
+ struct stream *s = __sc_strm(sc);
+ const struct mux_ops *mux = sc_mux_ops(sc);
if (mux) {
if (mux->flags & MX_FL_HTX)
* transfer to the stream and <input> is set to BUF_NULL. On error, <input>
* buffer is unchanged and it is the caller responsibility to release it.
*/
-struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer *input)
+struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer *input)
{
struct stream *s;
struct task *t;
if (sess->fe->mode == PR_MODE_HTTP)
s->flags |= SF_HTX;
- s->scf = cs;
+ s->scf = sc;
if (sc_attach_strm(s->scf, s) < 0)
goto out_fail_attach_scf;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
s->scb->flags |= SC_FL_INDEP_STR;
- if (sc_ep_test(cs, SE_FL_WEBSOCKET))
+ if (sc_ep_test(sc, SE_FL_WEBSOCKET))
s->flags |= SF_WEBSOCKET;
- if (sc_conn(cs)) {
- const struct mux_ops *mux = sc_mux_ops(cs);
+ if (sc_conn(sc)) {
+ const struct mux_ops *mux = sc_mux_ops(sc);
if (mux && mux->flags & MX_FL_HTX)
s->flags |= SF_HTX;
goto out_fail_accept;
/* finish initialization of the accepted file descriptor */
- if (sc_appctx(cs))
+ if (sc_appctx(sc))
se_will_consume(s->scf->sedesc);
if (sess->fe->accept && sess->fe->accept(s) < 0)
*/
int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_proto)
{
- struct stconn *cs = s->scf;
+ struct stconn *sc = s->scf;
struct connection *conn;
/* Already an HTTP stream */
if (unlikely(!s->txn && !http_create_txn(s)))
return 0;
- conn = sc_conn(cs);
+ conn = sc_conn(sc);
if (conn) {
se_have_more_data(s->scf->sedesc);
/* Make sure we're unsubscribed, the the new
* the underlying XPRT
*/
if (s->scf->wait_event.events)
- conn->mux->unsubscribe(cs, s->scf->wait_event.events, &(s->scf->wait_event));
+ conn->mux->unsubscribe(sc, s->scf->wait_event.events, &(s->scf->wait_event));
if (conn->mux->flags & MX_FL_NO_UPG)
return 0;
- if (conn_upgrade_mux_fe(conn, cs, &s->req.buf,
+ if (conn_upgrade_mux_fe(conn, sc, &s->req.buf,
(mux_proto ? mux_proto->token : ist("")),
PROTO_MODE_HTTP) == -1)
return 0;
* Note that this does not change the stream connector's current state, though
* it updates the previous state to the current one.
*/
-static void stream_update_both_cs(struct stream *s)
+static void stream_update_both_sc(struct stream *s)
{
struct stconn *scf = s->scf;
struct stconn *scb = s->scb;
if ((sess->fe->options & PR_O_CONTSTATS) && (s->flags & SF_BE_ASSIGNED) && !(s->flags & SF_IGNORE))
stream_process_counters(s);
- stream_update_both_cs(s);
+ stream_update_both_sc(s);
/* Trick: if a request is being waiting for the server to respond,
* and if we know the server can timeout, we don't want the timeout
* stream termination flags so that the caller does not have to worry about
* them. It's installed as ->srv_error for the server-side stream connector.
*/
-void default_srv_error(struct stream *s, struct stconn *cs)
+void default_srv_error(struct stream *s, struct stconn *sc)
{
int err_type = s->conn_err_type;
int err = 0, fin = 0;
* buffer is full and it needs to be called again, otherwise non-zero. It is
* designed to be called from stats_dump_strm_to_buffer() below.
*/
-static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm)
+static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm)
{
- struct appctx *appctx = __sc_appctx(cs);
+ struct appctx *appctx = __sc_appctx(sc);
struct show_sess_ctx *ctx = appctx->svcctx;
struct stconn *scf, *scb;
struct tm tm;
static int cli_io_handler_dump_sess(struct appctx *appctx)
{
struct show_sess_ctx *ctx = appctx->svcctx;
- struct stconn *cs = appctx_cs(appctx);
+ struct stconn *sc = appctx_cs(appctx);
struct connection *conn;
thread_isolate();
goto done;
}
- if (unlikely(sc_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
+ if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
/* If we're forced to shut down, we might have to remove our
* reference to the last stream being dumped.
*/
LIST_APPEND(&curr_strm->back_refs, &ctx->bref.users);
/* call the proper dump() function and return if we're missing space */
- if (!stats_dump_full_strm_to_buffer(cs, curr_strm))
+ if (!stats_dump_full_strm_to_buffer(sc, curr_strm))
goto full;
/* stream dump complete */