static inline struct stconn *chn_prod(const struct channel *chn)
{
if (chn->flags & CF_ISRESP)
- return LIST_ELEM(chn, struct stream *, res)->csb;
+ return LIST_ELEM(chn, struct stream *, res)->scb;
else
- return LIST_ELEM(chn, struct stream *, req)->csf;
+ return LIST_ELEM(chn, struct stream *, req)->scf;
}
/* returns a pointer to the stream connector consuming the channel (producer) */
static inline struct stconn *chn_cons(const struct channel *chn)
{
if (chn->flags & CF_ISRESP)
- return LIST_ELEM(chn, struct stream *, res)->csf;
+ return LIST_ELEM(chn, struct stream *, res)->scf;
else
- return LIST_ELEM(chn, struct stream *, req)->csb;
+ return LIST_ELEM(chn, struct stream *, req)->scb;
}
/* c_orig() : returns the pointer to the channel buffer's origin */
{
struct stream *strm = __cs_strm(cs);
- return ((cs->flags & CS_FL_ISBACK) ? strm->csf : strm->csb);
+ return ((cs->flags & CS_FL_ISBACK) ? strm->scf : strm->scb);
}
struct vars vars_txn; /* list of variables for the txn scope. */
struct vars vars_reqres; /* list of variables for the request and resp scope. */
- struct stconn *csf; /* frontend stream connector */
- struct stconn *csb; /* backend stream connector */
+ struct stconn *scf; /* frontend stream connector */
+ struct stconn *scb; /* backend stream connector */
struct strm_logs logs; /* logs for this stream */
if (may_dequeue_tasks(objt_server(s->target), s->be))
process_srv_queue(objt_server(s->target));
- sockaddr_free(&s->csb->dst);
+ sockaddr_free(&s->scb->dst);
s->flags &= ~(SF_DIRECT | SF_ASSIGNED);
- s->csb->state = CS_ST_REQ;
+ s->scb->state = CS_ST_REQ;
} else {
if (objt_server(s->target))
_HA_ATOMIC_INC(&__objt_server(s->target)->counters.retries);
_HA_ATOMIC_INC(&s->be->be_counters.retries);
- s->csb->state = CS_ST_ASS;
+ s->scb->state = CS_ST_ASS;
}
}
const struct sockaddr_storage *src;
case BE_LB_HASH_SRC:
- src = cs_src(s->csf);
+ src = cs_src(s->scf);
if (src && src->ss_family == AF_INET) {
srv = get_server_sh(s->be,
(void *)&((struct sockaddr_in *)src)->sin_addr,
* locally on multiple addresses at once. Nothing is done
* for AF_UNIX addresses.
*/
- dst = cs_dst(s->csf);
+ dst = cs_dst(s->scf);
if (dst && dst->ss_family == AF_INET) {
((struct sockaddr_in *)*ss)->sin_family = AF_INET;
((struct sockaddr_in *)*ss)->sin_addr =
if ((srv->flags & SRV_F_MAPPORTS)) {
int base_port;
- dst = cs_dst(s->csf);
+ dst = cs_dst(s->scf);
if (dst) {
/* First, retrieve the port from the incoming connection */
base_port = get_host_port(dst);
return SRV_STATUS_INTERNAL;
/* in transparent mode, use the original dest addr if no dispatch specified */
- dst = cs_dst(s->csf);
+ dst = cs_dst(s->scf);
if (dst && (dst->ss_family == AF_INET || dst->ss_family == AF_INET6))
**ss = *dst;
}
case CO_SRC_TPROXY_CLI:
case CO_SRC_TPROXY_CIP:
/* FIXME: what can we do if the client connects in IPv6 or unix socket ? */
- addr = cs_src(s->csf);
+ addr = cs_src(s->scf);
if (!addr)
return SRV_STATUS_INTERNAL;
return ret;
/* we're in the process of establishing a connection */
- s->csb->state = CS_ST_CON;
+ s->scb->state = CS_ST_CON;
}
else {
/* try to reuse the existing connection, it will be
*/
/* Is the connection really ready ? */
if (conn->mux->ctl(conn, MUX_STATUS, NULL) & MUX_STATUS_READY)
- s->csb->state = CS_ST_RDY;
+ s->scb->state = CS_ST_RDY;
else
- s->csb->state = CS_ST_CON;
+ s->scb->state = CS_ST_CON;
}
/* needs src ip/port for logging */
/*
* This function initiates a connection to the server assigned to this stream
- * (s->target, (s->csb)->addr.to). It will assign a server if none
+ * (s->target, (s->scb)->addr.to). It will assign a server if none
* is assigned yet.
* It can return one of :
* - SF_ERR_NONE if everything's OK
* it can be NULL for dispatch mode or transparent backend */
srv = objt_server(s->target);
- err = alloc_dst_address(&s->csb->dst, srv, s);
+ err = alloc_dst_address(&s->scb->dst, srv, s);
if (err != SRV_STATUS_OK)
return SF_ERR_INTERNAL;
/* 3. destination address */
if (srv && (!is_addr(&srv->addr) || srv->flags & SRV_F_MAPPORTS))
- hash_params.dst_addr = s->csb->dst;
+ hash_params.dst_addr = s->scb->dst;
/* 4. source address */
hash_params.src_addr = bind_addr;
}
if (avail >= 1) {
- if (srv_conn->mux->attach(srv_conn, s->csb->sedesc, s->sess) == -1) {
+ if (srv_conn->mux->attach(srv_conn, s->scb->sedesc, s->sess) == -1) {
srv_conn = NULL;
- if (cs_reset_endp(s->csb) < 0)
+ if (cs_reset_endp(s->scb) < 0)
return SF_ERR_INTERNAL;
- sc_ep_clr(s->csb, ~SE_FL_DETACHED);
+ sc_ep_clr(s->scb, ~SE_FL_DETACHED);
}
}
else
return SF_ERR_RESOURCE;
/* copy the target address into the connection */
- *srv_conn->dst = *s->csb->dst;
+ *srv_conn->dst = *s->scb->dst;
/* Copy network namespace from client connection */
srv_conn->proxy_netns = cli_conn ? cli_conn->proxy_netns : NULL;
return SF_ERR_INTERNAL; /* how did we get there ? */
}
- if (cs_attach_mux(s->csb, NULL, srv_conn) < 0) {
+ if (cs_attach_mux(s->scb, NULL, srv_conn) < 0) {
conn_free(srv_conn);
return SF_ERR_INTERNAL; /* how did we get there ? */
}
- srv_conn->ctx = s->csb;
+ srv_conn->ctx = s->scb;
#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
if (!srv ||
/* disable lingering */
if (s->be->options & PR_O_TCP_NOLING)
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
if (s->flags & SF_SRV_REUSED) {
_HA_ATOMIC_INC(&s->be->be_counters.reuse);
if (init_mux) {
const struct mux_ops *alt_mux =
likely(!(s->flags & SF_WEBSOCKET)) ? NULL : srv_get_ws_proto(srv);
- if (conn_install_mux_be(srv_conn, s->csb, s->sess, alt_mux) < 0) {
+ if (conn_install_mux_be(srv_conn, s->scb, s->sess, alt_mux) < 0) {
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
*/
((cli_conn->flags & CO_FL_EARLY_DATA) ||
((s->be->retry_type & PR_RE_EARLY_ERROR) && !s->conn_retries)) &&
- !channel_is_empty(cs_oc(s->csb)) &&
+ !channel_is_empty(cs_oc(s->scb)) &&
srv_conn->flags & CO_FL_SSL_WAIT_HS)
srv_conn->flags &= ~(CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN);
#endif
* loopback on a heavily loaded system.
*/
if (srv_conn->flags & CO_FL_ERROR)
- sc_ep_set(s->csb, SE_FL_ERROR);
+ sc_ep_set(s->scb, SE_FL_ERROR);
/* If we had early data, and the handshake ended, then
* we can remove the flag, and attempt to wake the task up,
* the handshake.
*/
if (!(srv_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)))
- sc_ep_clr(s->csb, SE_FL_WAIT_FOR_HS);
+ sc_ep_clr(s->scb, SE_FL_WAIT_FOR_HS);
- if (!cs_state_in(s->csb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO) &&
+ if (!cs_state_in(s->scb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO) &&
(srv_conn->flags & CO_FL_WAIT_XPRT) == 0) {
s->conn_exp = TICK_ETERNITY;
- cs_oc(s->csb)->flags |= CF_WRITE_NULL;
- if (s->csb->state == CS_ST_CON)
- s->csb->state = CS_ST_RDY;
+ cs_oc(s->scb)->flags |= CF_WRITE_NULL;
+ if (s->scb->state == CS_ST_CON)
+ s->scb->state = CS_ST_RDY;
}
/* Report EOI on the channel if it was reached from the mux point of
* wake callback. Otherwise si_cs_recv()/si_cs_send() already take
* care of it.
*/
- if (sc_ep_test(s->csb, SE_FL_EOI) && !(cs_ic(s->csb)->flags & CF_EOI))
- cs_ic(s->csb)->flags |= (CF_EOI|CF_READ_PARTIAL);
+ if (sc_ep_test(s->scb, SE_FL_EOI) && !(cs_ic(s->scb)->flags & CF_EOI))
+ cs_ic(s->scb)->flags |= (CF_EOI|CF_READ_PARTIAL);
/* catch all sync connect while the mux is not already installed */
if (!srv_conn->mux && !(srv_conn->flags & CO_FL_WAIT_XPRT)) {
if (((s->flags & (SF_DIRECT|SF_FORCE_PRST)) == SF_DIRECT) &&
(s->be->options & PR_O_REDISP)) {
s->flags &= ~(SF_DIRECT | SF_ASSIGNED);
- sockaddr_free(&s->csb->dst);
+ sockaddr_free(&s->scb->dst);
goto redispatch;
}
case SRV_STATUS_QUEUED:
s->conn_exp = tick_add_ifset(now_ms, s->be->timeout.queue);
- s->csb->state = CS_ST_QUE;
+ s->scb->state = CS_ST_QUE;
/* do nothing else and do not wake any other stream up */
return 1;
void back_try_conn_req(struct stream *s)
{
struct server *srv = objt_server(s->target);
- struct stconn *cs = s->csb;
+ struct stconn *cs = s->scb;
struct channel *req = &s->req;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
*/
void back_handle_st_req(struct stream *s)
{
- struct stconn *cs = s->csb;
+ struct stconn *cs = s->scb;
if (cs->state != CS_ST_REQ)
return;
*/
void back_handle_st_con(struct stream *s)
{
- struct stconn *cs = s->csb;
+ struct stconn *cs = s->scb;
struct channel *req = &s->req;
struct channel *rep = &s->res;
*/
void back_handle_st_cer(struct stream *s)
{
- struct stconn *cs = s->csb;
+ struct stconn *cs = s->scb;
int must_tar = sc_ep_test(cs, SE_FL_ERROR);
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
*/
void back_handle_st_rdy(struct stream *s)
{
- struct stconn *cs = s->csb;
+ struct stconn *cs = s->scb;
struct channel *req = &s->req;
struct channel *rep = &s->res;
/* Here the appctx must exists because the CS was set to
* CS_ST_RDY state when the appctx was created.
*/
- BUG_ON(!cs_appctx(s->csb));
+ BUG_ON(!cs_appctx(s->scb));
if (tv_iszero(&s->logs.tv_request))
s->logs.tv_request = now;
}
s->target = &http_cache_applet.obj_type;
- if ((appctx = cs_applet_create(s->csb, objt_applet(s->target)))) {
+ if ((appctx = cs_applet_create(s->scb, objt_applet(s->target)))) {
struct cache_appctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
appctx->st0 = HTX_CACHE_INIT;
return 0;
/* Get appctx from the stream connector. */
- appctx = cs_appctx(smp->strm->csb);
+ appctx = cs_appctx(smp->strm->scb);
if (appctx && appctx->rule) {
cconf = appctx->rule->arg.act.p[0];
if (cconf) {
void pcli_write_prompt(struct stream *s)
{
struct buffer *msg = get_trash_chunk();
- struct channel *oc = cs_oc(s->csf);
+ struct channel *oc = cs_oc(s->scf);
if (!(s->pcli_flags & PCLI_F_PROMPT))
return;
pcli_write_prompt(s);
- s->csb->flags |= CS_FL_NOLINGER | CS_FL_NOHALF;
- cs_shutr(s->csb);
- cs_shutw(s->csb);
+ s->scb->flags |= CS_FL_NOLINGER | CS_FL_NOHALF;
+ cs_shutr(s->scb);
+ cs_shutw(s->scb);
/*
* starting from there this the same code as
/* only release our endpoint if we don't intend to reuse the
* connection.
*/
- if (!cs_conn_ready(s->csb)) {
+ if (!cs_conn_ready(s->scb)) {
s->srv_conn = NULL;
- if (cs_reset_endp(s->csb) < 0) {
+ if (cs_reset_endp(s->scb) < 0) {
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_OTHER;
if (s->srv_error)
- s->srv_error(s, s->csb);
+ s->srv_error(s, s->scb);
return 1;
}
- se_fl_clr(s->csb->sedesc, ~SE_FL_DETACHED);
+ se_fl_clr(s->scb->sedesc, ~SE_FL_DETACHED);
}
- sockaddr_free(&s->csb->dst);
+ sockaddr_free(&s->scb->dst);
- cs_set_state(s->csb, CS_ST_INI);
- s->csb->flags &= CS_FL_ISBACK | CS_FL_DONT_WAKE; /* we're in the context of process_stream */
+ cs_set_state(s->scb, CS_ST_INI);
+ s->scb->flags &= CS_FL_ISBACK | CS_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);
s->flags &= ~(SF_DIRECT|SF_ASSIGNED|SF_BE_ASSIGNED|SF_FORCE_PRST|SF_IGNORE_PRST);
s->res.rex = TICK_ETERNITY;
s->res.wex = TICK_ETERNITY;
s->res.analyse_exp = TICK_ETERNITY;
- s->csb->hcto = TICK_ETERNITY;
+ s->scb->hcto = TICK_ETERNITY;
/* we're removing the analysers, we MUST re-enable events detection.
* We don't enable close on the response channel since it's either
memcpy(hdr->sig, pp2_signature, PP2_SIGNATURE_LEN);
if (strm) {
- src = cs_src(strm->csf);
- dst = cs_dst(strm->csf);
+ src = cs_src(strm->scf);
+ dst = cs_dst(strm->scf);
}
else if (remote && conn_get_src(remote) && conn_get_dst(remote)) {
src = conn_src(remote);
const struct sockaddr_storage *dst = NULL;
if (strm) {
- src = cs_src(strm->csf);
- dst = cs_dst(strm->csf);
+ src = cs_src(strm->scf);
+ dst = cs_dst(strm->scf);
}
else if (remote && conn_get_src(remote) && conn_get_dst(remote)) {
src = conn_src(remote);
conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
/* No connection or a connection with a RAW muxx */
if (!conn || (conn->mux && !(conn->mux->flags & MX_FL_HTX)))
conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
if (!conn)
return 0;
conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
if (!conn)
return 0;
if (!*args[3]) {
return cli_err(appctx,
"Usage: debug dev stream { <obj> <op> <value> | wake }*\n"
- " <obj> = {strm | strm.f | strm.x | csf.s | csb.s |\n"
+ " <obj> = {strm | strm.f | strm.x | scf.s | scb.s |\n"
" txn.f | req.f | req.r | req.w | res.f | res.r | res.w}\n"
" <op> = {'' (show) | '=' (assign) | '^' (xor) | '+' (or) | '-' (andnot)}\n"
" <value> = 'now' | 64-bit dec/hex integer (0x prefix supported)\n"
ptr = (!s || !may_access(s)) ? NULL : &s->req.wex; size = sizeof(s->req.wex);
} else if (isteq(name, ist("res.w"))) {
ptr = (!s || !may_access(s)) ? NULL : &s->res.wex; size = sizeof(s->res.wex);
- } else if (isteq(name, ist("csf.s"))) {
- ptr = (!s || !may_access(s)) ? NULL : &s->csf->state; size = sizeof(s->csf->state);
- } else if (isteq(name, ist("csb.s"))) {
- ptr = (!s || !may_access(s)) ? NULL : &s->csf->state; size = sizeof(s->csb->state);
+ } else if (isteq(name, ist("scf.s"))) {
+ ptr = (!s || !may_access(s)) ? NULL : &s->scf->state; size = sizeof(s->scf->state);
+ } else if (isteq(name, ist("scb.s"))) {
+ ptr = (!s || !may_access(s)) ? NULL : &s->scf->state; size = sizeof(s->scb->state);
} else if (isteq(name, ist("wake"))) {
if (s && may_access(s) && may_access((void *)s + sizeof(*s) - 1))
task_wakeup(s->task, TASK_WOKEN_TIMER|TASK_WOKEN_IO|TASK_WOKEN_MSG);
goto error;
s = appctx_strm(appctx);
- s->csb->dst = addr;
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->dst = addr;
+ s->scb->flags |= CS_FL_NOLINGER;
s->target = &ds->dss->srv->obj_type;
s->flags = SF_ASSIGNED;
stream_set_backend(s, agent->b.be);
/* applet is waiting for data */
- cs_cant_get(s->csf);
+ cs_cant_get(s->scf);
s->do_log = NULL;
s->res.flags |= CF_READ_DONTWAIT;
s->do_log(s);
}
else if (conn) {
- src = cs_src(s->csf);
+ src = cs_src(s->scf);
if (!src)
send_log(fe, LOG_INFO, "Connect from unknown source to listener %d (%s/%s)\n",
l->luid, fe->id, (fe->mode == PR_MODE_HTTP) ? "HTTP" : "TCP");
switch (addr_to_str(src, pn, sizeof(pn))) {
case AF_INET:
case AF_INET6:
- dst = cs_dst(s->csf);
+ dst = cs_dst(s->scf);
if (dst) {
addr_to_str(dst, sn, sizeof(sn));
port = get_host_port(dst);
int alpn_len;
/* try to report the ALPN value when available (also works for NPN) */
- if (conn == cs_conn(s->csf)) {
+ if (conn == cs_conn(s->scf)) {
if (conn_get_alpn(conn, &alpn_str, &alpn_len) && alpn_str) {
int len = MIN(alpn_len, sizeof(alpn) - 1);
memcpy(alpn, alpn_str, len);
}
}
- src = cs_src(s->csf);
+ src = cs_src(s->scf);
if (!src) {
chunk_printf(&trash, "%08x:%s.accept(%04x)=%04x from [listener:%d] ALPN=%s\n",
s->uniq_id, fe->id, (unsigned short)l->rx.fd, (unsigned short)conn->handle.fd,
* and retrieve data from the server. The connection is initialized
* with the "struct server".
*/
- cs_set_state(s->csb, CS_ST_ASS);
+ cs_set_state(s->scb, CS_ST_ASS);
/* Force destination server. */
s->flags |= SF_DIRECT | SF_ASSIGNED | SF_BE_ASSIGNED;
appctx = container_of(peer, struct hlua_csk_ctx, xref)->appctx;
s = appctx_strm(appctx);
- conn = cs_conn(s->csb);
+ conn = cs_conn(s->scb);
if (!conn || !conn_get_src(conn)) {
xref_unlock(&socket->xref, peer);
lua_pushnil(L);
return 2;
}
- appctx = __cs_appctx(s->csf);
+ appctx = __cs_appctx(s->scf);
/* Check for connection established. */
if (csk_ctx->connected) {
/* inform the stream that we want to be notified whenever the
* connection completes.
*/
- cs_cant_get(s->csf);
- cs_rx_endp_more(s->csf);
+ cs_cant_get(s->scf);
+ cs_rx_endp_more(s->scf);
appctx_wakeup(appctx);
hlua->gc_count++;
*/
if (!s->target && http_stats_check_uri(s, txn, px)) {
s->target = &http_stats_applet.obj_type;
- if (unlikely(!cs_applet_create(s->csb, objt_applet(s->target)))) {
+ if (unlikely(!cs_applet_create(s->scb, objt_applet(s->target)))) {
s->logs.tv_request = now;
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_RESOURCE;
* asks for it.
*/
if ((sess->fe->options | s->be->options) & PR_O_FWDFOR) {
- const struct sockaddr_storage *src = cs_src(s->csf);
+ const struct sockaddr_storage *src = cs_src(s->scf);
struct http_hdr_ctx ctx = { .blk = NULL };
struct ist hdr = isttest(s->be->fwdfor_hdr_name) ? s->be->fwdfor_hdr_name : sess->fe->fwdfor_hdr_name;
* asks for it.
*/
if ((sess->fe->options | s->be->options) & PR_O_ORGTO) {
- const struct sockaddr_storage *dst = cs_dst(s->csf);
+ const struct sockaddr_storage *dst = cs_dst(s->scf);
struct ist hdr = isttest(s->be->orgto_hdr_name) ? s->be->orgto_hdr_name : sess->fe->orgto_hdr_name;
if (dst && dst->ss_family == AF_INET) {
if (s->be->options & PR_O_ABRT_CLOSE) {
channel_auto_read(req);
if ((req->flags & (CF_SHUTR|CF_READ_NULL)) && !(txn->flags & TX_CON_WANT_TUN))
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
channel_auto_close(req);
}
else if (s->txn->meth == HTTP_METH_POST) {
res->analyse_exp = TICK_ETERNITY;
res->total = 0;
- if (cs_reset_endp(s->csb) < 0) {
+ if (cs_reset_endp(s->scb) < 0) {
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_INTERNAL;
return -1;
if (unlikely(htx_is_empty(htx) || htx->first == -1)) {
/* 1: have we encountered a read error ? */
if (rep->flags & CF_READ_ERROR) {
- struct connection *conn = cs_conn(s->csb);
+ struct connection *conn = cs_conn(s->scb);
/* Perform a L7 retry because server refuses the early data. */
if ((txn->flags & TX_L7_RETRY) &&
(s->be->retry_type & PR_RE_EARLY_ERROR) &&
conn && conn->err_code == CO_ER_SSL_EARLY_FAILED &&
- do_l7_retry(s, s->csb) == 0) {
+ do_l7_retry(s, s->scb) == 0) {
DBG_TRACE_DEVEL("leaving on L7 retry",
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
return 0;
stream_inc_http_fail_ctr(s);
}
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
else if (rep->flags & CF_READ_TIMEOUT) {
if ((txn->flags & TX_L7_RETRY) &&
(s->be->retry_type & PR_RE_TIMEOUT)) {
- if (co_data(rep) || do_l7_retry(s, s->csb) == 0) {
+ if (co_data(rep) || do_l7_retry(s, s->scb) == 0) {
DBG_TRACE_DEVEL("leaving on L7 retry",
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
return 0;
txn->status = 504;
stream_inc_http_fail_ctr(s);
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
else if (rep->flags & CF_SHUTR) {
if ((txn->flags & TX_L7_RETRY) &&
(s->be->retry_type & PR_RE_DISCONNECTED)) {
- if (co_data(rep) || do_l7_retry(s, s->csb) == 0) {
+ if (co_data(rep) || do_l7_retry(s, s->scb) == 0) {
DBG_TRACE_DEVEL("leaving on L7 retry",
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
return 0;
txn->status = 502;
stream_inc_http_fail_ctr(s);
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
/* Perform a L7 retry because of the status code */
if ((txn->flags & TX_L7_RETRY) &&
l7_status_match(s->be, sl->info.res.status) &&
- do_l7_retry(s, s->csb) == 0) {
+ do_l7_retry(s, s->scb) == 0) {
DBG_TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
return 0;
}
/* check for NTML authentication headers in 401 (WWW-Authenticate) and
* 407 (Proxy-Authenticate) responses and set the connection to private
*/
- srv_conn = cs_conn(s->csb);
+ srv_conn = cs_conn(s->scb);
if (srv_conn) {
struct ist hdr;
struct http_hdr_ctx ctx;
}
if ((s->be->retry_type & PR_RE_JUNK_REQUEST) &&
(txn->flags & TX_L7_RETRY) &&
- do_l7_retry(s, s->csb) == 0) {
+ do_l7_retry(s, s->scb) == 0) {
DBG_TRACE_DEVEL("leaving on L7 retry",
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
return 0;
if (!(s->flags & SF_FINST_MASK))
s->flags |= SF_FINST_H;
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
DBG_TRACE_DEVEL("leaving on error",
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn);
return 0;
return_prx_cond:
s->logs.t_data = -1; /* was not a valid response */
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_PRXCOND;
struct http_msg *msg = &txn->req;
struct uri_auth *uri_auth = s->be->uri_auth;
const char *h, *lookup, *end;
- struct appctx *appctx = __cs_appctx(s->csb);
+ struct appctx *appctx = __cs_appctx(s->scb);
struct show_stat_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
struct htx *htx;
struct htx_sl *sl;
/* if the server closes the connection, we want to immediately react
* and close the socket to save packets and syscalls.
*/
- s->csb->flags |= CS_FL_NOHALF;
+ s->scb->flags |= CS_FL_NOHALF;
/* In any case we've finished parsing the request so we must
* disable Nagle when sending data because 1) we're not going
http_msg_closed:
/* if we don't know whether the server will close, we need to hard close */
if (txn->rsp.flags & HTTP_MSGF_XFER_LEN)
- s->csb->flags |= CS_FL_NOLINGER; /* we want to close ASAP */
+ s->scb->flags |= CS_FL_NOLINGER; /* we want to close ASAP */
/* see above in MSG_DONE why we only do this in these states */
if (!(s->be->options & PR_O_ABRT_CLOSE))
channel_dont_read(chn);
chunk_printf(&trash, "%08x:%s.%s[%04x:%04x]: ", s->uniq_id, s->be->id,
dir,
objt_conn(sess->origin) ? (unsigned short)__objt_conn(sess->origin)->handle.fd : -1,
- cs_conn(s->csb) ? (unsigned short)(__cs_conn(s->csb))->handle.fd : -1);
+ cs_conn(s->scb) ? (unsigned short)(__cs_conn(s->scb))->handle.fd : -1);
max = HTX_SL_P1_LEN(sl);
UBOUND(max, trash.size - trash.data - 3);
chunk_printf(&trash, "%08x:%s.%s[%04x:%04x]: ", s->uniq_id, s->be->id,
dir,
objt_conn(sess->origin) ? (unsigned short)__objt_conn(sess->origin)->handle.fd : -1,
- cs_conn(s->csb) ? (unsigned short)(__cs_conn(s->csb))->handle.fd : -1);
+ cs_conn(s->scb) ? (unsigned short)(__cs_conn(s->scb))->handle.fd : -1);
max = n.len;
UBOUND(max, trash.size - trash.data - 3);
struct http_txn *http_create_txn(struct stream *s)
{
struct http_txn *txn;
- struct stconn *cs = s->csf;
+ struct stconn *cs = s->scf;
txn = pool_alloc(pool_head_http_txn);
if (!txn)
if (doresolve) {
/* in order to do the set-dst we need to put the address on the front */
- s->csf->dst = addr;
+ s->scf->dst = addr;
} else {
/* in cases we don't use the resolve we already have the address
* and must put it on the backend side, some of the cases are
* not meant to be used on the frontend (sockpair, unix socket etc.) */
- s->csb->dst = addr;
+ s->scb->dst = addr;
}
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->flags |= CS_FL_NOLINGER;
s->flags |= SF_ASSIGNED;
s->res.flags |= CF_READ_DONTWAIT;
/* applet is waiting for data */
- cs_cant_get(s->csf);
+ cs_cant_get(s->scf);
appctx_wakeup(appctx);
hc->appctx = appctx;
*/
static int smp_fetch_base32_src(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- const struct sockaddr_storage *src = (smp->strm ? cs_src(smp->strm->csf) : NULL);
+ const struct sockaddr_storage *src = (smp->strm ? cs_src(smp->strm->scf) : NULL);
struct buffer *temp;
if (!src)
*/
static int smp_fetch_url32_src(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- const struct sockaddr_storage *src = (smp->strm ? cs_src(smp->strm->csf) : NULL);
+ const struct sockaddr_storage *src = (smp->strm ? cs_src(smp->strm->scf) : NULL);
struct buffer *temp;
if (!src)
if (likely(s)) {
be = s->be;
txn = s->txn;
- be_conn = cs_conn(s->csb);
+ be_conn = cs_conn(s->scb);
status = (txn ? txn->status : 0);
s_flags = s->flags;
uniq_id = s->uniq_id;
break;
case LOG_FMT_CLIENTIP: // %ci
- addr = (s ? cs_src(s->csf) : sess_src(sess));
+ addr = (s ? cs_src(s->scf) : sess_src(sess));
if (addr)
ret = lf_ip(tmplog, (struct sockaddr *)addr, dst + maxsize - tmplog, tmp);
else
break;
case LOG_FMT_CLIENTPORT: // %cp
- addr = (s ? cs_src(s->csf) : sess_src(sess));
+ addr = (s ? cs_src(s->scf) : sess_src(sess));
if (addr) {
/* sess->listener is always defined when the session's owner is an inbound connections */
if (addr->ss_family == AF_UNIX)
break;
case LOG_FMT_FRONTENDIP: // %fi
- addr = (s ? cs_dst(s->csf) : sess_dst(sess));
+ addr = (s ? cs_dst(s->scf) : sess_dst(sess));
if (addr)
ret = lf_ip(tmplog, (struct sockaddr *)addr, dst + maxsize - tmplog, tmp);
else
break;
case LOG_FMT_FRONTENDPORT: // %fp
- addr = (s ? cs_dst(s->csf) : sess_dst(sess));
+ addr = (s ? cs_dst(s->scf) : sess_dst(sess));
if (addr) {
/* sess->listener is always defined when the session's owner is an inbound connections */
if (addr->ss_family == AF_UNIX)
int block;
unsigned int flen = 0;
struct htx *htx = NULL;
- struct buffer *csbuf;
+ struct buffer *scbuf;
unsigned int sent;
TRACE_ENTER(H2_EV_RX_FRAME|H2_EV_RX_DATA, h2c->conn, h2s);
h2c->flags &= ~H2_CF_DEM_SFULL;
- csbuf = h2_get_buf(h2c, &h2s->rxbuf);
- if (!csbuf) {
+ scbuf = h2_get_buf(h2c, &h2s->rxbuf);
+ if (!scbuf) {
h2c->flags |= H2_CF_DEM_SALLOC;
TRACE_STATE("waiting for an h2s rxbuf", H2_EV_RX_FRAME|H2_EV_RX_DATA|H2_EV_H2S_BLK, h2c->conn, h2s);
goto fail;
}
- htx = htx_from_buf(csbuf);
+ htx = htx_from_buf(scbuf);
try_again:
flen = h2c->dfl - h2c->dpl;
h2c->rcvd_s += h2c->dpl;
h2c->dpl = 0;
h2c->st0 = H2_CS_FRAME_A; // send the corresponding window update
- htx_to_buf(htx, csbuf);
+ htx_to_buf(htx, scbuf);
TRACE_LEAVE(H2_EV_RX_FRAME|H2_EV_RX_DATA, h2c->conn, h2s);
return 1;
fail:
if (htx)
- htx_to_buf(htx, csbuf);
+ htx_to_buf(htx, scbuf);
TRACE_LEAVE(H2_EV_RX_FRAME|H2_EV_RX_DATA, h2c->conn, h2s);
return 0;
}
s = appctx_strm(appctx);
/* applet is waiting for data */
- cs_cant_get(s->csf);
+ cs_cant_get(s->scf);
appctx_wakeup(appctx);
/* initiate an outgoing connection */
- s->csb->dst = addr;
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->dst = addr;
+ s->scb->flags |= CS_FL_NOLINGER;
s->flags = SF_ASSIGNED;
s->target = peer_session_target(peer, s);
proxy_inc_be_ctr(be);
/* assign new parameters to the stream from the new backend */
- s->csb->flags &= ~CS_FL_INDEP_STR;
+ s->scb->flags &= ~CS_FL_INDEP_STR;
if (be->options2 & PR_O2_INDEPSTR)
- s->csb->flags |= CS_FL_INDEP_STR;
+ s->scb->flags |= CS_FL_INDEP_STR;
if (tick_isset(be->timeout.serverfin))
- s->csb->hcto = be->timeout.serverfin;
+ s->scb->hcto = be->timeout.serverfin;
/* We want to enable the backend-specific analysers except those which
* were already run as part of the frontend/listener. Note that it would
/* the entry might have been redistributed to another server */
if (!(strm->flags & SF_ASSIGNED))
- sockaddr_free(&strm->csb->dst);
+ sockaddr_free(&strm->scb->dst);
if (p->target) {
/* a server picked this pendconn, it must skip LB */
goto out_free_addr;
s = appctx_strm(appctx);
- s->csb->dst = addr;
- s->csb->flags |= CS_FL_NOLINGER;
+ s->scb->dst = addr;
+ s->scb->flags |= CS_FL_NOLINGER;
s->target = &sft->srv->obj_type;
s->flags = SF_ASSIGNED;
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
int i;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
ssl = ssl_sock_get_ssl_object(conn);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
ssl = ssl_sock_get_ssl_object(conn);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
else
conn = objt_conn(smp->sess->origin);
ssl = ssl_sock_get_ssl_object(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
smp->data.type = SMP_T_BOOL;
smp->data.u.sint = conn_is_ssl(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
ssl = ssl_sock_get_ssl_object(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
smp->flags = 0;
ssl = ssl_sock_get_ssl_object(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
smp->flags = 0;
ssl = ssl_sock_get_ssl_object(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
smp->flags = 0;
ssl = ssl_sock_get_ssl_object(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
ssl = ssl_sock_get_ssl_object(conn);
if (!ssl)
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
ssl = ssl_sock_get_ssl_object(conn);
if (!ssl)
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
smp->flags = 0;
ssl = ssl_sock_get_ssl_object(conn);
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
ssl = ssl_sock_get_ssl_object(conn);
if (!ssl)
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
ssl = ssl_sock_get_ssl_object(conn);
if (!ssl)
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
ssl = ssl_sock_get_ssl_object(conn);
if (!ssl)
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
if (!conn)
return 0;
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
if (!conn)
return 0;
const char *sfx;
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
if (!conn)
return 0;
conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
else
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->csb) : NULL;
+ smp->strm ? cs_conn(smp->strm->scb) : NULL;
smp->flags = 0;
ssl = ssl_sock_get_ssl_object(conn);
struct stconn *cs;
conn = objt_conn(sess->origin);
- cs = s->csf;
+ cs = s->scf;
if (conn && cs) {
if (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_SSL_WAIT_HS)) {
/* Front and back stream connector state */
chunk_appendf(&trace_buf, " CS=(%s,%s)",
- cs_state_str(s->csf->state), cs_state_str(s->csb->state));
+ cs_state_str(s->scf->state), cs_state_str(s->scb->state));
/* If txn is defined, HTTP req/rep states */
if (txn)
task, s, s->flags, s->conn_err_type, txn->flags, txn->req.flags, txn->rsp.flags, txn->status);
}
else {
- chunk_appendf(&trace_buf, " - t=%p s=(%p,0x%08x,0x%x) csf=(%p,%d,0x%08x) csb=(%p,%d,0x%08x) retries=%d",
+ chunk_appendf(&trace_buf, " - t=%p s=(%p,0x%08x,0x%x) scf=(%p,%d,0x%08x) scb=(%p,%d,0x%08x) retries=%d",
task, s, s->flags, s->conn_err_type,
- s->csf, s->csf->state, s->csf->flags,
- s->csb, s->csb->state, s->csb->flags,
+ s->scf, s->scf->state, s->scf->flags,
+ s->scb, s->scb->state, s->scb->flags,
s->conn_retries);
}
{
struct stream *s = arg;
- if (!s->req.buf.size && !s->req.pipe && sc_ep_test(s->csf, SE_FL_RXBLK_BUFF) &&
+ if (!s->req.buf.size && !s->req.pipe && sc_ep_test(s->scf, SE_FL_RXBLK_BUFF) &&
b_alloc(&s->req.buf))
- cs_rx_buff_rdy(s->csf);
- else if (!s->res.buf.size && !s->res.pipe && sc_ep_test(s->csb, SE_FL_RXBLK_BUFF) &&
+ cs_rx_buff_rdy(s->scf);
+ else if (!s->res.buf.size && !s->res.pipe && sc_ep_test(s->scb, SE_FL_RXBLK_BUFF) &&
b_alloc(&s->res.buf))
- cs_rx_buff_rdy(s->csb);
+ cs_rx_buff_rdy(s->scb);
else
return 0;
if (sess->fe->mode == PR_MODE_HTTP)
s->flags |= SF_HTX;
- s->csf = cs;
- if (cs_attach_strm(s->csf, s) < 0)
- goto out_fail_attach_csf;
+ s->scf = cs;
+ if (cs_attach_strm(s->scf, s) < 0)
+ goto out_fail_attach_scf;
- s->csb = cs_new_from_strm(s, CS_FL_ISBACK);
- if (!s->csb)
- goto out_fail_alloc_csb;
+ s->scb = cs_new_from_strm(s, CS_FL_ISBACK);
+ if (!s->scb)
+ goto out_fail_alloc_scb;
- cs_set_state(s->csf, CS_ST_EST);
- s->csf->hcto = sess->fe->timeout.clientfin;
+ cs_set_state(s->scf, CS_ST_EST);
+ s->scf->hcto = sess->fe->timeout.clientfin;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
- s->csf->flags |= CS_FL_INDEP_STR;
+ s->scf->flags |= CS_FL_INDEP_STR;
- s->csb->hcto = TICK_ETERNITY;
+ s->scb->hcto = TICK_ETERNITY;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
- s->csb->flags |= CS_FL_INDEP_STR;
+ s->scb->flags |= CS_FL_INDEP_STR;
if (sc_ep_test(cs, SE_FL_WEBSOCKET))
s->flags |= SF_WEBSOCKET;
/* finish initialization of the accepted file descriptor */
if (cs_appctx(cs))
- cs_want_get(s->csf);
+ cs_want_get(s->scf);
if (sess->fe->accept && sess->fe->accept(s) < 0)
goto out_fail_accept;
out_fail_accept:
flt_stream_release(s, 0);
LIST_DELETE(&s->list);
- out_fail_attach_csf:
- cs_free(s->csb);
- out_fail_alloc_csb:
+ out_fail_attach_scf:
+ cs_free(s->scb);
+ out_fail_alloc_scb:
task_destroy(t);
out_fail_alloc:
pool_free(pool_head_stream, s);
}
LIST_DELETE(&s->list);
- cs_destroy(s->csb);
- cs_destroy(s->csf);
+ cs_destroy(s->scb);
+ cs_destroy(s->scf);
pool_free(pool_head_stream, s);
*/
static void back_establish(struct stream *s)
{
- struct connection *conn = cs_conn(s->csb);
+ struct connection *conn = cs_conn(s->scb);
struct channel *req = &s->req;
struct channel *rep = &s->res;
s->flags &= ~SF_CONN_EXP;
/* errors faced after sending data need to be reported */
- if (sc_ep_test(s->csb, SE_FL_ERROR) && req->flags & CF_WROTE_DATA) {
+ if (sc_ep_test(s->scb, SE_FL_ERROR) && req->flags & CF_WROTE_DATA) {
/* Don't add CF_WRITE_ERROR if we're here because
* early data were rejected by the server, or
* http_wait_for_response() will never be called
rep->analysers |= strm_fe(s)->fe_rsp_ana | s->be->be_rsp_ana;
- cs_rx_endp_more(s->csb);
+ cs_rx_endp_more(s->scb);
rep->flags |= CF_READ_ATTACHED; /* producer is now attached */
if (conn) {
/* real connections have timeouts
* delayed recv here to give a chance to the data to flow back
* by the time we process other tasks.
*/
- cs_chk_rcv(s->csb);
+ cs_chk_rcv(s->scb);
}
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. */
if (rep->flags & (CF_SHUTR | CF_SHUTW)) {
- s->csb->state = CS_ST_DIS;
+ s->scb->state = CS_ST_DIS;
DBG_TRACE_STATE("response channel shutdwn for read/write", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s);
}
static void sess_set_term_flags(struct stream *s)
{
if (!(s->flags & SF_FINST_MASK)) {
- if (s->csb->state == CS_ST_INI) {
+ if (s->scb->state == CS_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)
s->flags |= SF_FINST_R;
}
- else if (s->csb->state == CS_ST_QUE)
+ else if (s->scb->state == CS_ST_QUE)
s->flags |= SF_FINST_Q;
- else if (cs_state_in(s->csb->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, CS_SB_REQ|CS_SB_TAR|CS_SB_ASS|CS_SB_CON|CS_SB_CER|CS_SB_RDY))
s->flags |= SF_FINST_C;
- else if (s->csb->state == CS_ST_EST || s->prev_conn_state == CS_ST_EST)
+ else if (s->scb->state == CS_ST_EST || s->prev_conn_state == CS_ST_EST)
s->flags |= SF_FINST_D;
else
s->flags |= SF_FINST_L;
if (flags & ACT_OPT_FIRST) {
/* Register applet. this function schedules the applet. */
s->target = &rule->applet.obj_type;
- appctx = cs_applet_create(s->csb, objt_applet(s->target));
+ appctx = cs_applet_create(s->scb, objt_applet(s->target));
if (unlikely(!appctx))
return ACT_RET_ERR;
return ACT_RET_ERR;
}
else
- appctx = __cs_appctx(s->csb);
+ appctx = __cs_appctx(s->scb);
if (rule->from != ACT_F_HTTP_REQ) {
if (sess->fe == s->be) /* report it if the request was intercepted by the frontend */
}
/* Now we can schedule the applet. */
- cs_cant_get(s->csb);
+ cs_cant_get(s->scb);
appctx_wakeup(appctx);
return ACT_RET_STOP;
}
*/
int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_proto)
{
- struct stconn *cs = s->csf;
+ struct stconn *cs = s->scf;
struct connection *conn;
/* Already an HTTP stream */
conn = cs_conn(cs);
if (conn) {
- cs_rx_endp_more(s->csf);
+ cs_rx_endp_more(s->scf);
/* Make sure we're unsubscribed, the the new
* mux will probably want to subscribe to
* the underlying XPRT
*/
- if (s->csf->wait_event.events)
- conn->mux->unsubscribe(cs, s->csf->wait_event.events, &(s->csf->wait_event));
+ if (s->scf->wait_event.events)
+ conn->mux->unsubscribe(cs, s->scf->wait_event.events, &(s->scf->wait_event));
if (conn->mux->flags & MX_FL_NO_UPG)
return 0;
*/
static void stream_update_both_cs(struct stream *s)
{
- struct stconn *csf = s->csf;
- struct stconn *csb = s->csb;
+ struct stconn *scf = s->scf;
+ struct stconn *scb = s->scb;
struct channel *req = &s->req;
struct channel *res = &s->res;
req->flags &= ~(CF_READ_NULL|CF_READ_PARTIAL|CF_READ_ATTACHED|CF_WRITE_NULL|CF_WRITE_PARTIAL);
res->flags &= ~(CF_READ_NULL|CF_READ_PARTIAL|CF_READ_ATTACHED|CF_WRITE_NULL|CF_WRITE_PARTIAL);
- s->prev_conn_state = csb->state;
+ s->prev_conn_state = scb->state;
/* let's recompute both sides states */
- if (cs_state_in(csf->state, CS_SB_RDY|CS_SB_EST))
- cs_update(csf);
+ if (cs_state_in(scf->state, CS_SB_RDY|CS_SB_EST))
+ cs_update(scf);
- if (cs_state_in(csb->state, CS_SB_RDY|CS_SB_EST))
- cs_update(csb);
+ if (cs_state_in(scb->state, CS_SB_RDY|CS_SB_EST))
+ cs_update(scb);
/* stream connectors are processed outside of process_stream() and must be
* handled at the latest moment.
*/
- if (cs_appctx(csf)) {
- 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(scf)) {
+ if ((cs_rx_endp_ready(scf) && !cs_rx_blocked(scf)) ||
+ (cs_tx_endp_ready(scf) && !cs_tx_blocked(scf)))
+ appctx_wakeup(__cs_appctx(scf));
}
- if (cs_appctx(csb)) {
- if ((cs_rx_endp_ready(csb) && !cs_rx_blocked(csb)) ||
- (cs_tx_endp_ready(csb) && !cs_tx_blocked(csb)))
- appctx_wakeup(__cs_appctx(csb));
+ if (cs_appctx(scb)) {
+ if ((cs_rx_endp_ready(scb) && !cs_rx_blocked(scb)) ||
+ (cs_tx_endp_ready(scb) && !cs_tx_blocked(scb)))
+ appctx_wakeup(__cs_appctx(scb));
}
}
unsigned int rp_cons_last, rp_prod_last;
unsigned int req_ana_back;
struct channel *req, *res;
- struct stconn *csf, *csb;
+ struct stconn *scf, *scb;
unsigned int rate;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC, s);
req = &s->req;
res = &s->res;
- csf = s->csf;
- csb = s->csb;
+ scf = s->scf;
+ scb = s->scb;
/* First, attempt to receive pending data from I/O layers */
- cs_conn_sync_recv(csf);
- cs_conn_sync_recv(csb);
+ cs_conn_sync_recv(scf);
+ cs_conn_sync_recv(scb);
/* Let's check if we're looping without making any progress, e.g. due
* to a bogus analyser or the fact that we're ignoring a read0. The
rpf_last = res->flags & ~CF_MASK_ANALYSER;
/* we don't want the stream connector functions to recursively wake us up */
- csf->flags |= CS_FL_DONT_WAKE;
- csb->flags |= CS_FL_DONT_WAKE;
+ scf->flags |= CS_FL_DONT_WAKE;
+ scb->flags |= CS_FL_DONT_WAKE;
/* update pending events */
s->pending_events |= (state & TASK_WOKEN_ANY);
channel_check_timeouts(req);
if (unlikely((req->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
- csb->flags |= CS_FL_NOLINGER;
- cs_shutw(csb);
+ scb->flags |= CS_FL_NOLINGER;
+ cs_shutw(scb);
}
if (unlikely((req->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
- if (csf->flags & CS_FL_NOHALF)
- csf->flags |= CS_FL_NOLINGER;
- cs_shutr(csf);
+ if (scf->flags & CS_FL_NOHALF)
+ scf->flags |= CS_FL_NOLINGER;
+ cs_shutr(scf);
}
channel_check_timeouts(res);
if (unlikely((res->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
- csf->flags |= CS_FL_NOLINGER;
- cs_shutw(csf);
+ scf->flags |= CS_FL_NOLINGER;
+ cs_shutw(scf);
}
if (unlikely((res->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
- if (csb->flags & CS_FL_NOHALF)
- csb->flags |= CS_FL_NOLINGER;
- cs_shutr(csb);
+ if (scb->flags & CS_FL_NOHALF)
+ scb->flags |= CS_FL_NOLINGER;
+ cs_shutr(scb);
}
if (HAS_FILTERS(s))
(CF_SHUTR|CF_READ_ACTIVITY|CF_READ_TIMEOUT|CF_SHUTW|
CF_WRITE_ACTIVITY|CF_WRITE_TIMEOUT|CF_ANA_TIMEOUT)) &&
!(s->flags & SF_CONN_EXP) &&
- !((sc_ep_get(csf) | csb->flags) & SE_FL_ERROR) &&
+ !((sc_ep_get(scf) | scb->flags) & SE_FL_ERROR) &&
((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {
- csf->flags &= ~CS_FL_DONT_WAKE;
- csb->flags &= ~CS_FL_DONT_WAKE;
+ scf->flags &= ~CS_FL_DONT_WAKE;
+ scb->flags &= ~CS_FL_DONT_WAKE;
goto update_exp_and_leave;
}
}
* must be be reviewed too.
*/
if (!stream_alloc_work_buffer(s)) {
- sc_ep_set(s->csf, SE_FL_ERROR);
+ sc_ep_set(s->scf, SE_FL_ERROR);
s->conn_err_type = STRM_ET_CONN_RES;
- sc_ep_set(s->csb, SE_FL_ERROR);
+ sc_ep_set(s->scb, SE_FL_ERROR);
s->conn_err_type = STRM_ET_CONN_RES;
if (!(s->flags & SF_ERR_MASK))
* connection setup code must be able to deal with any type of abort.
*/
srv = objt_server(s->target);
- if (unlikely(sc_ep_test(csf, SE_FL_ERROR))) {
- if (cs_state_in(csf->state, CS_SB_EST|CS_SB_DIS)) {
- cs_shutr(csf);
- cs_shutw(csf);
- cs_report_error(csf);
+ if (unlikely(sc_ep_test(scf, SE_FL_ERROR))) {
+ if (cs_state_in(scf->state, CS_SB_EST|CS_SB_DIS)) {
+ cs_shutr(scf);
+ cs_shutw(scf);
+ cs_report_error(scf);
if (!(req->analysers) && !(res->analysers)) {
_HA_ATOMIC_INC(&s->be->be_counters.cli_aborts);
_HA_ATOMIC_INC(&sess->fe->fe_counters.cli_aborts);
}
}
- if (unlikely(sc_ep_test(csb, SE_FL_ERROR))) {
- if (cs_state_in(csb->state, CS_SB_EST|CS_SB_DIS)) {
- cs_shutr(csb);
- cs_shutw(csb);
- cs_report_error(csb);
+ if (unlikely(sc_ep_test(scb, SE_FL_ERROR))) {
+ if (cs_state_in(scb->state, CS_SB_EST|CS_SB_DIS)) {
+ cs_shutr(scb);
+ cs_shutw(scb);
+ cs_report_error(scb);
_HA_ATOMIC_INC(&s->be->be_counters.failed_resp);
if (srv)
_HA_ATOMIC_INC(&srv->counters.failed_resp);
/* note: maybe we should process connection errors here ? */
}
- if (cs_state_in(csb->state, CS_SB_CON|CS_SB_RDY)) {
+ if (cs_state_in(scb->state, CS_SB_CON|CS_SB_RDY)) {
/* we were trying to establish a connection on the server side,
* maybe it succeeded, maybe it failed, maybe we timed out, ...
*/
- if (csb->state == CS_ST_RDY)
+ if (scb->state == CS_ST_RDY)
back_handle_st_rdy(s);
- else if (s->csb->state == CS_ST_CON)
+ else if (s->scb->state == CS_ST_CON)
back_handle_st_con(s);
- if (csb->state == CS_ST_CER)
+ if (scb->state == CS_ST_CER)
back_handle_st_cer(s);
- else if (csb->state == CS_ST_EST)
+ else if (scb->state == CS_ST_EST)
back_establish(s);
/* state is now one of CS_ST_CON (still in progress), CS_ST_EST
*/
}
- rq_prod_last = csf->state;
- rq_cons_last = csb->state;
- rp_cons_last = csf->state;
- rp_prod_last = csb->state;
+ rq_prod_last = scf->state;
+ rq_cons_last = scb->state;
+ rp_cons_last = scf->state;
+ rp_prod_last = scb->state;
/* Check for connection closure */
DBG_TRACE_POINT(STRM_EV_STRM_PROC, s);
/* nothing special to be done on client side */
- if (unlikely(csf->state == CS_ST_DIS)) {
- csf->state = CS_ST_CLO;
+ if (unlikely(scf->state == CS_ST_DIS)) {
+ scf->state = CS_ST_CLO;
/* This is needed only when debugging is enabled, to indicate
* client-side close.
(global.mode & MODE_VERBOSE)))) {
chunk_printf(&trash, "%08x:%s.clicls[%04x:%04x]\n",
s->uniq_id, s->be->id,
- (unsigned short)conn_fd(cs_conn(csf)),
- (unsigned short)conn_fd(cs_conn(csb)));
+ (unsigned short)conn_fd(cs_conn(scf)),
+ (unsigned short)conn_fd(cs_conn(scb)));
DISGUISE(write(1, trash.area, trash.data));
}
}
/* When a server-side connection is released, we have to count it and
* check for pending connections on this server.
*/
- if (unlikely(csb->state == CS_ST_DIS)) {
- csb->state = CS_ST_CLO;
+ if (unlikely(scb->state == CS_ST_DIS)) {
+ scb->state = CS_ST_CLO;
srv = objt_server(s->target);
if (srv) {
if (s->flags & SF_CURR_SESS) {
if (s->prev_conn_state == CS_ST_EST) {
chunk_printf(&trash, "%08x:%s.srvcls[%04x:%04x]\n",
s->uniq_id, s->be->id,
- (unsigned short)conn_fd(cs_conn(csf)),
- (unsigned short)conn_fd(cs_conn(csb)));
+ (unsigned short)conn_fd(cs_conn(scf)),
+ (unsigned short)conn_fd(cs_conn(scb)));
DISGUISE(write(1, trash.area, trash.data));
}
}
if (((req->flags & ~rqf_last) & CF_MASK_ANALYSER) ||
((req->flags ^ rqf_last) & CF_MASK_STATIC) ||
(req->analysers && (req->flags & CF_SHUTW)) ||
- csf->state != rq_prod_last ||
- csb->state != rq_cons_last ||
+ scf->state != rq_prod_last ||
+ scb->state != rq_cons_last ||
s->pending_events & TASK_WOKEN_MSG) {
unsigned int flags = req->flags;
- if (cs_state_in(csf->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) {
+ if (cs_state_in(scf->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) {
int max_loops = global.tune.maxpollevents;
unsigned int ana_list;
unsigned int ana_back;
}
}
- rq_prod_last = csf->state;
- rq_cons_last = csb->state;
+ rq_prod_last = scf->state;
+ rq_cons_last = scb->state;
req->flags &= ~CF_WAKE_ONCE;
rqf_last = req->flags;
if (((res->flags & ~rpf_last) & CF_MASK_ANALYSER) ||
(res->flags ^ rpf_last) & CF_MASK_STATIC ||
(res->analysers && (res->flags & CF_SHUTW)) ||
- csf->state != rp_cons_last ||
- csb->state != rp_prod_last ||
+ scf->state != rp_cons_last ||
+ scb->state != rp_prod_last ||
s->pending_events & TASK_WOKEN_MSG) {
unsigned int flags = res->flags;
- if (cs_state_in(csb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) {
+ if (cs_state_in(scb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) {
int max_loops = global.tune.maxpollevents;
unsigned int ana_list;
unsigned int ana_back;
}
}
- rp_cons_last = csf->state;
- rp_prod_last = csb->state;
+ rp_cons_last = scf->state;
+ rp_prod_last = scb->state;
res->flags &= ~CF_WAKE_ONCE;
rpf_last = res->flags;
* the backend stream connector is in the CS_ST_INI
* state. It is switched into the CS_ST_CLO state and
* the request channel is erased. */
- if (csb->state == CS_ST_INI) {
- s->csb->state = CS_ST_CLO;
+ if (scb->state == CS_ST_INI) {
+ s->scb->state = CS_ST_CLO;
channel_abort(req);
if (IS_HTX_STRM(s))
channel_htx_erase(req, htxbuf(&req->buf));
*/
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(csf->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO)) &&
+ (cs_state_in(scf->state, CS_SB_EST|CS_SB_DIS|CS_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
if (!(req->flags & (CF_KERN_SPLICING|CF_SHUTR)) &&
req->to_forward &&
(global.tune.options & GTUNE_USE_SPLICE) &&
- (cs_conn(csf) && __cs_conn(csf)->xprt && __cs_conn(csf)->xprt->rcv_pipe &&
- __cs_conn(csf)->mux && __cs_conn(csf)->mux->rcv_pipe) &&
- (cs_conn(csb) && __cs_conn(csb)->xprt && __cs_conn(csb)->xprt->snd_pipe &&
- __cs_conn(csb)->mux && __cs_conn(csb)->mux->snd_pipe) &&
+ (cs_conn(scf) && __cs_conn(scf)->xprt && __cs_conn(scf)->xprt->rcv_pipe &&
+ __cs_conn(scf)->mux && __cs_conn(scf)->mux->rcv_pipe) &&
+ (cs_conn(scb) && __cs_conn(scb)->xprt && __cs_conn(scb)->xprt->snd_pipe &&
+ __cs_conn(scb)->mux && __cs_conn(scb)->mux->snd_pipe) &&
(pipes_used < global.maxpipes) &&
(((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_REQ) ||
(((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_AUT) &&
* - there are data scheduled for emission in the buffer
* - the CF_AUTO_CONNECT flag is set (active connection)
*/
- if (csb->state == CS_ST_INI) {
+ if (scb->state == CS_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.
*/
- csb->state = CS_ST_REQ; /* new connection requested */
+ scb->state = CS_ST_REQ; /* new connection requested */
s->conn_retries = 0;
if ((s->be->retry_type &~ PR_RE_CONN_FAILED) &&
(s->be->mode == PR_MODE_HTTP) &&
}
}
else {
- s->csb->state = CS_ST_CLO; /* shutw+ini = abort */
+ s->scb->state = CS_ST_CLO; /* shutw+ini = abort */
channel_shutw_now(req); /* fix buffer flags upon abort */
channel_shutr_now(res);
}
/* we may have a pending connection request, or a connection waiting
* for completion.
*/
- if (cs_state_in(csb->state, CS_SB_REQ|CS_SB_QUE|CS_SB_TAR|CS_SB_ASS)) {
+ if (cs_state_in(scb->state, CS_SB_REQ|CS_SB_QUE|CS_SB_TAR|CS_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))
/* 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 (csb->state != CS_ST_REQ)
+ if (scb->state != CS_ST_REQ)
back_try_conn_req(s);
- if (csb->state == CS_ST_REQ)
+ if (scb->state == CS_ST_REQ)
back_handle_st_req(s);
/* get a chance to complete an immediate connection setup */
- if (csb->state == CS_ST_RDY)
+ if (scb->state == CS_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(csb->state == CS_ST_EST))
+ if (unlikely(scb->state == CS_ST_EST))
back_establish(s);
srv = objt_server(s->target);
- if (csb->state == CS_ST_ASS && srv && srv->rdr_len && (s->flags & SF_REDIRECTABLE))
- http_perform_server_redirect(s, csb);
- } while (csb->state == CS_ST_ASS);
+ if (scb->state == CS_ST_ASS && srv && srv->rdr_len && (s->flags & SF_REDIRECTABLE))
+ http_perform_server_redirect(s, scb);
+ } while (scb->state == CS_ST_ASS);
}
/* Let's see if we can send the pending request now */
- cs_conn_sync_send(csb);
+ cs_conn_sync_send(scb);
/*
* Now forward all shutdown requests between both sides of the request buffer
*/
if (unlikely((req->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CLOSE|CF_SHUTR)) ==
(CF_AUTO_CLOSE|CF_SHUTR) &&
- (csb->state != CS_ST_CON || (s->be->options & PR_O_ABRT_CLOSE)))) {
+ (scb->state != CS_ST_CON || (s->be->options & PR_O_ABRT_CLOSE)))) {
channel_shutw_now(req);
}
if (unlikely((req->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
channel_is_empty(req))) {
if (req->flags & CF_READ_ERROR)
- csb->flags |= CS_FL_NOLINGER;
- cs_shutw(csb);
+ scb->flags |= CS_FL_NOLINGER;
+ cs_shutw(scb);
}
/* shutdown(write) done on server side, we must stop the client too */
/* shutdown(read) pending */
if (unlikely((req->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
- if (csf->flags & CS_FL_NOHALF)
- csf->flags |= CS_FL_NOLINGER;
- cs_shutr(csf);
+ if (scf->flags & CS_FL_NOHALF)
+ scf->flags |= CS_FL_NOLINGER;
+ cs_shutr(scf);
}
/* Benchmarks have shown that it's optimal to do a full resync now */
- if (csf->state == CS_ST_DIS ||
- cs_state_in(csb->state, CS_SB_RDY|CS_SB_DIS) ||
- (sc_ep_test(csf, SE_FL_ERROR) && csf->state != CS_ST_CLO) ||
- (sc_ep_test(csb, SE_FL_ERROR) && csb->state != CS_ST_CLO))
+ 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))
goto resync_stconns;
/* otherwise we want to check if we need to resync the req buffer or not */
*/
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(csb->state, CS_SB_EST|CS_SB_DIS|CS_SB_CLO) &&
+ cs_state_in(scb->state, CS_SB_EST|CS_SB_DIS|CS_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
if (!(res->flags & (CF_KERN_SPLICING|CF_SHUTR)) &&
res->to_forward &&
(global.tune.options & GTUNE_USE_SPLICE) &&
- (cs_conn(csf) && __cs_conn(csf)->xprt && __cs_conn(csf)->xprt->snd_pipe &&
- __cs_conn(csf)->mux && __cs_conn(csf)->mux->snd_pipe) &&
- (cs_conn(csb) && __cs_conn(csb)->xprt && __cs_conn(csb)->xprt->rcv_pipe &&
- __cs_conn(csb)->mux && __cs_conn(csb)->mux->rcv_pipe) &&
+ (cs_conn(scf) && __cs_conn(scf)->xprt && __cs_conn(scf)->xprt->snd_pipe &&
+ __cs_conn(scf)->mux && __cs_conn(scf)->mux->snd_pipe) &&
+ (cs_conn(scb) && __cs_conn(scb)->xprt && __cs_conn(scb)->xprt->rcv_pipe &&
+ __cs_conn(scb)->mux && __cs_conn(scb)->mux->rcv_pipe) &&
(pipes_used < global.maxpipes) &&
(((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_RTR) ||
(((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_AUT) &&
rpf_last = res->flags;
/* Let's see if we can send the pending response now */
- cs_conn_sync_send(csf);
+ cs_conn_sync_send(scf);
/*
* Now forward all shutdown requests between both sides of the buffer
/* shutdown(write) pending */
if (unlikely((res->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
channel_is_empty(res))) {
- cs_shutw(csf);
+ cs_shutw(scf);
}
/* shutdown(write) done on the client side, we must stop the server too */
/* shutdown(read) pending */
if (unlikely((res->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
- if (csb->flags & CS_FL_NOHALF)
- csb->flags |= CS_FL_NOLINGER;
- cs_shutr(csb);
+ if (scb->flags & CS_FL_NOHALF)
+ scb->flags |= CS_FL_NOLINGER;
+ cs_shutr(scb);
}
- if (csf->state == CS_ST_DIS ||
- cs_state_in(csb->state, CS_SB_RDY|CS_SB_DIS) ||
- (sc_ep_test(csf, SE_FL_ERROR) && csf->state != CS_ST_CLO) ||
- (sc_ep_test(csb, SE_FL_ERROR) && csb->state != CS_ST_CLO))
+ 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))
goto resync_stconns;
if ((req->flags & ~rqf_last) & CF_MASK_ANALYSER)
goto resync_request;
/* we're interested in getting wakeups again */
- csf->flags &= ~CS_FL_DONT_WAKE;
- csb->flags &= ~CS_FL_DONT_WAKE;
+ scf->flags &= ~CS_FL_DONT_WAKE;
+ scb->flags &= ~CS_FL_DONT_WAKE;
- if (likely((csf->state != CS_ST_CLO) || !cs_state_in(csb->state, CS_SB_INI|CS_SB_CLO) ||
+ if (likely((scf->state != CS_ST_CLO) || !cs_state_in(scb->state, CS_SB_INI|CS_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);
(!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
chunk_printf(&trash, "%08x:%s.closed[%04x:%04x]\n",
s->uniq_id, s->be->id,
- (unsigned short)conn_fd(cs_conn(csf)),
- (unsigned short)conn_fd(cs_conn(csb)));
+ (unsigned short)conn_fd(cs_conn(scf)),
+ (unsigned short)conn_fd(cs_conn(scb)));
DISGUISE(write(1, trash.area, trash.data));
}
*/
void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, char eol)
{
- const struct stconn *csf, *csb;
+ const struct stconn *scf, *scb;
const struct connection *cof, *cob;
const struct appctx *acf, *acb;
const struct server *srv;
req = &s->req;
res = &s->res;
- csf = s->csf;
- cof = cs_conn(csf);
- acf = cs_appctx(csf);
+ scf = s->scf;
+ cof = cs_conn(scf);
+ acf = cs_appctx(scf);
if (cof && cof->src && addr_to_str(cof->src, pn, sizeof(pn)) >= 0)
src = pn;
else if (acf)
src = acf->applet->name;
- csb = s->csb;
- cob = cs_conn(csb);
- acb = cs_appctx(csb);
+ scb = s->scb;
+ cob = cs_conn(scb);
+ acb = cs_appctx(scb);
srv = objt_server(s->target);
if (srv)
dst = srv->id;
"%sstrm=%p,%x src=%s fe=%s be=%s dst=%s%c"
"%stxn=%p,%x txn.req=%s,%x txn.rsp=%s,%x%c"
"%srqf=%x rqa=%x rpf=%x rpa=%x%c"
- "%scsf=%p,%s,%x csb=%p,%s,%x%c"
+ "%sscf=%p,%s,%x scb=%p,%s,%x%c"
"%saf=%p,%u sab=%p,%u%c"
"%scof=%p,%x:%s(%p)/%s(%p)/%s(%d)%c"
"%scob=%p,%x:%s(%p)/%s(%p)/%s(%d)%c"
(s->txn ? h1_msg_state_str(s->txn->req.msg_state): "-"), (s->txn ? s->txn->req.flags : 0),
(s->txn ? h1_msg_state_str(s->txn->rsp.msg_state): "-"), (s->txn ? s->txn->rsp.flags : 0), eol,
pfx, req->flags, req->analysers, res->flags, res->analysers, eol,
- pfx, csf, cs_state_str(csf->state), csf->flags, csb, cs_state_str(csb->state), csb->flags, eol,
+ pfx, scf, cs_state_str(scf->state), scf->flags, scb, cs_state_str(scb->state), scb->flags, eol,
pfx, acf, acf ? acf->st0 : 0, acb, acb ? acb->st0 : 0, eol,
pfx, cof, cof ? cof->flags : 0, conn_get_mux_name(cof), cof?cof->ctx:0, conn_get_xprt_name(cof),
cof ? cof->xprt_ctx : 0, conn_get_ctrl_name(cof), conn_fd(cof), eol,
{
struct appctx *appctx = __cs_appctx(cs);
struct show_sess_ctx *ctx = appctx->svcctx;
- struct stconn *csf, *csb;
+ struct stconn *scf, *scb;
struct tm tm;
extern const char *monthname[12];
char pn[INET6_ADDRSTRLEN];
else
chunk_appendf(&trash, " backend=<NONE> (id=-1 mode=-)");
- conn = cs_conn(strm->csb);
+ conn = cs_conn(strm->scb);
switch (conn && conn_get_src(conn) ? addr_to_str(conn->src, pn, sizeof(pn)) : AF_UNSPEC) {
case AF_INET:
case AF_INET6:
h1_msg_state_str(strm->txn->req.msg_state), h1_msg_state_str(strm->txn->rsp.msg_state),
strm->txn->req.flags, strm->txn->rsp.flags);
- csf = strm->csf;
- chunk_appendf(&trash, " csf=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
- csf, csf->flags, cs_state_str(csf->state),
- (sc_ep_test(csf, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(csf, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
- csf->sedesc->se, sc_ep_get(csf), csf->wait_event.events);
+ scf = strm->scf;
+ chunk_appendf(&trash, " scf=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
+ scf, scf->flags, cs_state_str(scf->state),
+ (sc_ep_test(scf, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(scf, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
+ scf->sedesc->se, sc_ep_get(scf), scf->wait_event.events);
- if ((conn = cs_conn(csf)) != NULL) {
+ if ((conn = cs_conn(scf)) != NULL) {
chunk_appendf(&trash,
" co0=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n",
conn,
conn_get_ctrl_name(conn),
conn_get_xprt_name(conn),
conn_get_mux_name(conn),
- cs_get_data_name(csf),
+ cs_get_data_name(scf),
obj_type_name(conn->target),
obj_base_ptr(conn->target));
conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].thread_mask: 0);
}
- else if ((tmpctx = cs_appctx(csf)) != NULL) {
+ else if ((tmpctx = cs_appctx(scf)) != NULL) {
chunk_appendf(&trash,
" app0=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n",
tmpctx,
(unsigned long long)tmpctx->t->cpu_time, (unsigned long long)tmpctx->t->lat_time);
}
- csb = strm->csb;
- chunk_appendf(&trash, " csb=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
- csb, csb->flags, cs_state_str(csb->state),
- (sc_ep_test(csb, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(csb, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
- csb->sedesc->se, sc_ep_get(csb), csb->wait_event.events);
+ scb = strm->scb;
+ chunk_appendf(&trash, " scb=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
+ scb, scb->flags, cs_state_str(scb->state),
+ (sc_ep_test(scb, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(scb, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
+ scb->sedesc->se, sc_ep_get(scb), scb->wait_event.events);
- if ((conn = cs_conn(csb)) != NULL) {
+ if ((conn = cs_conn(scb)) != NULL) {
chunk_appendf(&trash,
" co1=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n",
conn,
conn_get_ctrl_name(conn),
conn_get_xprt_name(conn),
conn_get_mux_name(conn),
- cs_get_data_name(csb),
+ cs_get_data_name(scb),
obj_type_name(conn->target),
obj_base_ptr(conn->target));
conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].thread_mask: 0);
}
- else if ((tmpctx = cs_appctx(csb)) != NULL) {
+ else if ((tmpctx = cs_appctx(scb)) != NULL) {
chunk_appendf(&trash,
" app1=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n",
tmpctx,
human_time(TICKS_TO_MS(curr_strm->res.analyse_exp - now_ms),
TICKS_TO_MS(1000)) : "");
- conn = cs_conn(curr_strm->csf);
+ conn = cs_conn(curr_strm->scf);
chunk_appendf(&trash,
- " csf=[%d,%1xh,fd=%d]",
- curr_strm->csf->state,
- curr_strm->csf->flags,
+ " scf=[%d,%1xh,fd=%d]",
+ curr_strm->scf->state,
+ curr_strm->scf->flags,
conn_fd(conn));
- conn = cs_conn(curr_strm->csb);
+ conn = cs_conn(curr_strm->scb);
chunk_appendf(&trash,
- " csb=[%d,%1xh,fd=%d]",
- curr_strm->csb->state,
- curr_strm->csb->flags,
+ " scb=[%d,%1xh,fd=%d]",
+ curr_strm->scb->state,
+ curr_strm->scb->flags,
conn_fd(conn));
chunk_appendf(&trash,
case ACT_F_TCP_REQ_CNT:
case ACT_F_HTTP_REQ:
- if (!cs_get_src(s->csf))
+ if (!cs_get_src(s->scf))
goto end;
- src = s->csf->src;
+ src = s->scf->src;
break;
default:
case ACT_F_TCP_REQ_CNT:
case ACT_F_HTTP_REQ:
- if (!cs_get_dst(s->csf))
+ if (!cs_get_dst(s->scf))
goto end;
- dst = s->csf->dst;
+ dst = s->scf->dst;
break;
default:
case ACT_F_TCP_REQ_CNT:
case ACT_F_HTTP_REQ:
- if (!cs_get_src(s->csf))
+ if (!cs_get_src(s->scf))
goto end;
- src = s->csf->src;
+ src = s->scf->src;
break;
default:
case ACT_F_TCP_REQ_CNT:
case ACT_F_HTTP_REQ:
- if (!cs_get_dst(s->csf))
+ if (!cs_get_dst(s->scf))
goto end;
- dst = s->csf->dst;
+ dst = s->scf->dst;
break;
default:
* is present, returning with ERR will cause lingering to be disabled.
*/
if (strm)
- strm->csf->flags |= CS_FL_NOLINGER;
+ strm->scf->flags |= CS_FL_NOLINGER;
if (conn->flags & CO_FL_FDLESS)
goto out;
if (kw[0] == 'b') { /* bc_src */
struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
? cs_conn(__objt_check(smp->sess->origin)->cs)
- : (smp->strm ? cs_conn(smp->strm->csb): NULL));
+ : (smp->strm ? cs_conn(smp->strm->scb): NULL));
if (conn && conn_get_src(conn))
src = conn_src(conn);
}
src = conn_src(conn);
}
else /* src */
- src = (smp->strm ? cs_src(smp->strm->csf) : sess_src(smp->sess));
+ src = (smp->strm ? cs_src(smp->strm->scf) : sess_src(smp->sess));
if (!src)
return 0;
if (kw[0] == 'b') { /* bc_src_port */
struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
? cs_conn(__objt_check(smp->sess->origin)->cs)
- : (smp->strm ? cs_conn(smp->strm->csb): NULL));
+ : (smp->strm ? cs_conn(smp->strm->scb): NULL));
if (conn && conn_get_src(conn))
src = conn_src(conn);
}
src = conn_src(conn);
}
else /* src_port */
- src = (smp->strm ? cs_src(smp->strm->csf) : sess_src(smp->sess));
+ src = (smp->strm ? cs_src(smp->strm->scf) : sess_src(smp->sess));
if (!src)
return 0;
if (kw[0] == 'b') { /* bc_dst */
struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
? cs_conn(__objt_check(smp->sess->origin)->cs)
- : (smp->strm ? cs_conn(smp->strm->csb): NULL));
+ : (smp->strm ? cs_conn(smp->strm->scb): NULL));
if (conn && conn_get_dst(conn))
dst = conn_dst(conn);
}
dst = conn_dst(conn);
}
else /* dst */
- dst = (smp->strm ? cs_dst(smp->strm->csf) : sess_dst(smp->sess));
+ dst = (smp->strm ? cs_dst(smp->strm->scf) : sess_dst(smp->sess));
if (!dst)
return 0;
dst = conn_dst(conn);
}
else /* dst_is_local */
- dst = (smp->strm ? cs_dst(smp->strm->csf) : sess_dst(smp->sess));
+ dst = (smp->strm ? cs_dst(smp->strm->scf) : sess_dst(smp->sess));
if (!dst)
return 0;
src = conn_src(conn);
}
else /* src_is_local */
- src = (smp->strm ? cs_src(smp->strm->csf) : sess_src(smp->sess));
+ src = (smp->strm ? cs_src(smp->strm->scf) : sess_src(smp->sess));
if (!src)
return 0;
if (kw[0] == 'b') { /* bc_dst_port */
struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
? cs_conn(__objt_check(smp->sess->origin)->cs)
- : (smp->strm ? cs_conn(smp->strm->csb): NULL));
+ : (smp->strm ? cs_conn(smp->strm->scb): NULL));
if (conn && conn_get_dst(conn))
dst = conn_dst(conn);
}
dst = conn_dst(conn);
}
else /* dst_port */
- dst = (smp->strm ? cs_dst(smp->strm->csf) : sess_dst(smp->sess));
+ dst = (smp->strm ? cs_dst(smp->strm->scf) : sess_dst(smp->sess));
if (!dst)
return 0;
* object can be other thing than a connection. For example,
* it be a appctx.
*/
- conn = (dir == 0 ? cs_conn(smp->strm->csf) : cs_conn(smp->strm->csb));
+ conn = (dir == 0 ? cs_conn(smp->strm->scf) : cs_conn(smp->strm->scb));
if (!conn)
return 0;