diff --git a/include/haproxy/channel.h b/include/haproxy/channel.h index 295ff1eb6..1b597e8d0 100644 --- a/include/haproxy/channel.h +++ b/include/haproxy/channel.h @@ -68,18 +68,18 @@ static inline struct stream *chn_strm(const struct channel *chn) 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 */ diff --git a/include/haproxy/cs_utils.h b/include/haproxy/cs_utils.h index d4dca09aa..052de02d1 100644 --- a/include/haproxy/cs_utils.h +++ b/include/haproxy/cs_utils.h @@ -81,7 +81,7 @@ static inline struct stconn *cs_opposite(struct stconn *cs) { 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); } diff --git a/include/haproxy/stream-t.h b/include/haproxy/stream-t.h index 170a6feee..728554fa4 100644 --- a/include/haproxy/stream-t.h +++ b/include/haproxy/stream-t.h @@ -187,8 +187,8 @@ struct stream { 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 */ diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h index d59f45a59..6f670261a 100644 --- a/include/haproxy/stream.h +++ b/include/haproxy/stream.h @@ -339,14 +339,14 @@ static inline void stream_choose_redispatch(struct stream *s) 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; } } diff --git a/src/backend.c b/src/backend.c index 95293cc78..02a4a8289 100644 --- a/src/backend.c +++ b/src/backend.c @@ -733,7 +733,7 @@ int assign_server(struct stream *s) 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, @@ -894,7 +894,7 @@ static int alloc_dst_address(struct sockaddr_storage **ss, * 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 = @@ -911,7 +911,7 @@ static int alloc_dst_address(struct sockaddr_storage **ss, 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); @@ -934,7 +934,7 @@ static int alloc_dst_address(struct sockaddr_storage **ss, 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; } @@ -1111,7 +1111,7 @@ static int alloc_bind_address(struct sockaddr_storage **ss, 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; @@ -1294,7 +1294,7 @@ static int do_connect_server(struct stream *s, struct connection *conn) 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 @@ -1302,9 +1302,9 @@ static int do_connect_server(struct stream *s, struct connection *conn) */ /* 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 */ @@ -1316,7 +1316,7 @@ static int do_connect_server(struct stream *s, struct connection *conn) /* * 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 @@ -1349,7 +1349,7 @@ static int connect_server(struct stream *s) * 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; @@ -1401,7 +1401,7 @@ static int connect_server(struct stream *s) /* 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; @@ -1574,11 +1574,11 @@ static int connect_server(struct stream *s) } 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 @@ -1624,7 +1624,7 @@ skip_reuse: 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; @@ -1651,11 +1651,11 @@ skip_reuse: 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 || @@ -1722,7 +1722,7 @@ skip_reuse: /* 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); @@ -1764,7 +1764,7 @@ skip_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; } @@ -1802,7 +1802,7 @@ skip_reuse: */ ((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 @@ -1826,7 +1826,7 @@ skip_reuse: * 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, @@ -1834,14 +1834,14 @@ skip_reuse: * 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 @@ -1851,8 +1851,8 @@ skip_reuse: * 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)) { @@ -1901,7 +1901,7 @@ int srv_redispatch_connect(struct stream *s) 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; } @@ -1924,7 +1924,7 @@ int srv_redispatch_connect(struct stream *s) 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; @@ -1970,7 +1970,7 @@ static int back_may_abort_req(struct channel *req, struct stream *s) 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); @@ -2160,7 +2160,7 @@ abort_connection: */ 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; @@ -2240,7 +2240,7 @@ void back_handle_st_req(struct stream *s) */ 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; @@ -2289,7 +2289,7 @@ void back_handle_st_con(struct stream *s) */ 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); @@ -2437,7 +2437,7 @@ void back_handle_st_cer(struct stream *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; @@ -2447,7 +2447,7 @@ void back_handle_st_rdy(struct stream *s) /* 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; diff --git a/src/cache.c b/src/cache.c index 7a998c011..8b523f25f 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1840,7 +1840,7 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p } 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; @@ -2691,7 +2691,7 @@ smp_fetch_res_cache_name(const struct arg *args, struct sample *smp, 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) { diff --git a/src/cli.c b/src/cli.c index 668380d45..b789996b3 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2176,7 +2176,7 @@ static int cli_parse_simple(char **args, char *payload, struct appctx *appctx, v 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; @@ -2704,9 +2704,9 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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 @@ -2773,22 +2773,22 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) /* 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); @@ -2843,7 +2843,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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 diff --git a/src/connection.c b/src/connection.c index 9df49b264..f286445cd 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1826,8 +1826,8 @@ static int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct 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); @@ -2025,8 +2025,8 @@ int make_proxy_line(char *buf, int buf_len, struct server *srv, struct connectio 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); @@ -2106,7 +2106,7 @@ smp_fetch_fc_http_major(const struct arg *args, struct sample *smp, const char * 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))) @@ -2203,7 +2203,7 @@ int smp_fetch_fc_err(const struct arg *args, struct sample *smp, const char *kw, 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; @@ -2230,7 +2230,7 @@ int smp_fetch_fc_err_str(const struct arg *args, struct sample *smp, const char 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; diff --git a/src/debug.c b/src/debug.c index 8e6640bbe..1f96d6aa9 100644 --- a/src/debug.c +++ b/src/debug.c @@ -694,7 +694,7 @@ static int debug_parse_cli_stream(char **args, char *payload, struct appctx *app 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" @@ -729,10 +729,10 @@ static int debug_parse_cli_stream(char **args, char *payload, struct appctx *app 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); diff --git a/src/dns.c b/src/dns.c index 4ee5a1b41..4fea59ccf 100644 --- a/src/dns.c +++ b/src/dns.c @@ -828,8 +828,8 @@ static int dns_session_init(struct appctx *appctx) 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; diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 88d2d84f8..c96341d77 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -1241,7 +1241,7 @@ spoe_init_appctx(struct appctx *appctx) 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; diff --git a/src/frontend.c b/src/frontend.c index 55a4c0767..d2e949d41 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -62,7 +62,7 @@ int frontend_accept(struct stream *s) 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"); @@ -73,7 +73,7 @@ int frontend_accept(struct stream *s) 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); @@ -105,7 +105,7 @@ int frontend_accept(struct stream *s) 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); @@ -113,7 +113,7 @@ int frontend_accept(struct stream *s) } } - 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, diff --git a/src/hlua.c b/src/hlua.c index e332308ca..4cda8257c 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2000,7 +2000,7 @@ static int hlua_socket_init(struct appctx *appctx) * 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; @@ -2678,7 +2678,7 @@ static int hlua_socket_getsockname(struct lua_State *L) 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); @@ -2747,7 +2747,7 @@ __LJMP static int hlua_socket_connect_yield(struct lua_State *L, int status, lua return 2; } - appctx = __cs_appctx(s->csf); + appctx = __cs_appctx(s->scf); /* Check for connection established. */ if (csk_ctx->connected) { @@ -2858,8 +2858,8 @@ __LJMP static int hlua_socket_connect(struct lua_State *L) /* 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++; diff --git a/src/http_ana.c b/src/http_ana.c index bdc67a27a..1a79648ef 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -430,7 +430,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s */ 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; @@ -662,7 +662,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit) * 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; @@ -719,7 +719,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit) * 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) { @@ -1119,7 +1119,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) 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) { @@ -1263,7 +1263,7 @@ static __inline int do_l7_retry(struct stream *s, struct stconn *cs) 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; @@ -1335,13 +1335,13 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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; @@ -1364,7 +1364,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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)) @@ -1380,7 +1380,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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; @@ -1394,7 +1394,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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)) @@ -1433,7 +1433,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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; @@ -1451,7 +1451,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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)) @@ -1501,7 +1501,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) /* 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; } @@ -1666,7 +1666,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) /* 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; @@ -1729,7 +1729,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) } 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; @@ -1746,7 +1746,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) 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; @@ -2056,7 +2056,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s 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; @@ -3973,7 +3973,7 @@ static int http_handle_stats(struct stream *s, struct channel *req) 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; @@ -4372,7 +4372,7 @@ static void http_end_request(struct stream *s) /* 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 @@ -4447,7 +4447,7 @@ static void http_end_request(struct stream *s) 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); @@ -5098,7 +5098,7 @@ static void http_debug_stline(const char *dir, struct stream *s, const struct ht 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); @@ -5129,7 +5129,7 @@ static void http_debug_hdr(const char *dir, struct stream *s, const struct ist n 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); @@ -5165,7 +5165,7 @@ void http_txn_reset_res(struct http_txn *txn) 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) diff --git a/src/http_client.c b/src/http_client.c index e3666e6d5..a725e97d9 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -1007,20 +1007,20 @@ static int httpclient_applet_init(struct appctx *appctx) 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; diff --git a/src/http_fetch.c b/src/http_fetch.c index 55f34b8b5..27900908b 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -1186,7 +1186,7 @@ static int smp_fetch_base32(const struct arg *args, struct sample *smp, const ch */ 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) @@ -2053,7 +2053,7 @@ static int smp_fetch_url32(const struct arg *args, struct sample *smp, const cha */ 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) diff --git a/src/log.c b/src/log.c index 717a9a04e..330deb871 100644 --- a/src/log.c +++ b/src/log.c @@ -1982,7 +1982,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t 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; @@ -2114,7 +2114,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t 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 @@ -2127,7 +2127,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t 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) @@ -2145,7 +2145,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t 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 @@ -2158,7 +2158,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t 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) diff --git a/src/mux_h2.c b/src/mux_h2.c index 132ecb7e0..694d6a775 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -5040,20 +5040,20 @@ static int h2_frt_transfer_data(struct h2s *h2s) 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; @@ -5132,12 +5132,12 @@ try_again: 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; } diff --git a/src/peers.c b/src/peers.c index 2d261369b..c466b6a02 100644 --- a/src/peers.c +++ b/src/peers.c @@ -1085,12 +1085,12 @@ static int peer_session_init(struct appctx *appctx) 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); diff --git a/src/proxy.c b/src/proxy.c index f3ace05c8..77e6d4981 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -2358,12 +2358,12 @@ int stream_set_backend(struct stream *s, struct proxy *be) 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 diff --git a/src/queue.c b/src/queue.c index 94f9da858..6933326a6 100644 --- a/src/queue.c +++ b/src/queue.c @@ -600,7 +600,7 @@ int pendconn_dequeue(struct stream *strm) /* 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 */ diff --git a/src/sink.c b/src/sink.c index fc9db73dc..a0ac7effb 100644 --- a/src/sink.c +++ b/src/sink.c @@ -607,8 +607,8 @@ static int sink_forward_session_init(struct appctx *appctx) 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; diff --git a/src/ssl_sample.c b/src/ssl_sample.c index 46697cec6..ea5677c65 100644 --- a/src/ssl_sample.c +++ b/src/ssl_sample.c @@ -526,7 +526,7 @@ smp_fetch_ssl_x_der(const struct arg *args, struct sample *smp, const char *kw, 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); @@ -581,7 +581,7 @@ smp_fetch_ssl_x_chain_der(const struct arg *args, struct sample *smp, const char 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); @@ -644,7 +644,7 @@ smp_fetch_ssl_x_serial(const struct arg *args, struct sample *smp, const char *k 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); @@ -697,7 +697,7 @@ smp_fetch_ssl_x_sha1(const struct arg *args, struct sample *smp, const char *kw, 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); @@ -748,7 +748,7 @@ smp_fetch_ssl_x_notafter(const struct arg *args, struct sample *smp, const char 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); @@ -800,7 +800,7 @@ smp_fetch_ssl_x_i_dn(const struct arg *args, struct sample *smp, const char *kw, 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); @@ -868,7 +868,7 @@ smp_fetch_ssl_x_notbefore(const struct arg *args, struct sample *smp, const char 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); @@ -920,7 +920,7 @@ smp_fetch_ssl_x_s_dn(const struct arg *args, struct sample *smp, const char *kw, 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); @@ -1017,7 +1017,7 @@ smp_fetch_ssl_x_version(const struct arg *args, struct sample *smp, const char * 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); @@ -1062,7 +1062,7 @@ smp_fetch_ssl_x_sig_alg(const struct arg *args, struct sample *smp, const char * 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); @@ -1119,7 +1119,7 @@ smp_fetch_ssl_x_key_alg(const struct arg *args, struct sample *smp, const char * 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); @@ -1171,7 +1171,7 @@ smp_fetch_ssl_fc(const struct arg *args, struct sample *smp, const char *kw, voi 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); @@ -1208,7 +1208,7 @@ smp_fetch_ssl_fc_is_resumed(const struct arg *args, struct sample *smp, const ch 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); @@ -1231,7 +1231,7 @@ smp_fetch_ssl_fc_cipher(const struct arg *args, struct sample *smp, const char * 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); @@ -1265,7 +1265,7 @@ smp_fetch_ssl_fc_alg_keysize(const struct arg *args, struct sample *smp, const c 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); @@ -1296,7 +1296,7 @@ smp_fetch_ssl_fc_use_keysize(const struct arg *args, struct sample *smp, const c 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); @@ -1328,7 +1328,7 @@ smp_fetch_ssl_fc_npn(const struct arg *args, struct sample *smp, const char *kw, 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) @@ -1363,7 +1363,7 @@ smp_fetch_ssl_fc_alpn(const struct arg *args, struct sample *smp, const char *kw 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) @@ -1396,7 +1396,7 @@ smp_fetch_ssl_fc_protocol(const struct arg *args, struct sample *smp, const char 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); @@ -1434,7 +1434,7 @@ smp_fetch_ssl_fc_session_id(const struct arg *args, struct sample *smp, const ch 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) @@ -1466,7 +1466,7 @@ smp_fetch_ssl_fc_random(const struct arg *args, struct sample *smp, const char * 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) @@ -1503,7 +1503,7 @@ smp_fetch_ssl_fc_session_key(const struct arg *args, struct sample *smp, const c 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) @@ -1652,7 +1652,7 @@ smp_fetch_ssl_fc_err(const struct arg *args, struct sample *smp, const char *kw, 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; @@ -1705,7 +1705,7 @@ smp_fetch_ssl_fc_err_str(const struct arg *args, struct sample *smp, const char 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; @@ -1838,7 +1838,7 @@ static int smp_fetch_ssl_x_keylog(const struct arg *args, struct sample *smp, co 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; @@ -1935,7 +1935,7 @@ smp_fetch_ssl_fc_unique_id(const struct arg *args, struct sample *smp, const cha 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); diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 1c614d2c4..6578e91f4 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -7885,7 +7885,7 @@ enum act_return ssl_action_wait_for_hs(struct act_rule *rule, struct proxy *px, 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)) { diff --git a/src/stream.c b/src/stream.c index 7e802a681..0302ee6f4 100644 --- a/src/stream.c +++ b/src/stream.c @@ -173,7 +173,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace /* 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) @@ -205,10 +205,10 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace 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); } @@ -313,12 +313,12 @@ int stream_buf_available(void *arg) { 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; @@ -445,23 +445,23 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer 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; @@ -537,7 +537,7 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer /* 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; @@ -567,9 +567,9 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer 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); @@ -708,8 +708,8 @@ void stream_free(struct 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); @@ -873,7 +873,7 @@ int stream_set_timeout(struct stream *s, enum act_timeout_name name, int timeout */ 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; @@ -886,7 +886,7 @@ static void back_establish(struct stream *s) 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 @@ -917,7 +917,7 @@ static void back_establish(struct stream *s) 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 @@ -936,13 +936,13 @@ static void back_establish(struct stream *s) * 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); } @@ -956,7 +956,7 @@ static void back_establish(struct stream *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) @@ -964,11 +964,11 @@ static void sess_set_term_flags(struct stream *s) 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; @@ -992,7 +992,7 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px, 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; @@ -1002,7 +1002,7 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px, 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 */ @@ -1013,7 +1013,7 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px, } /* Now we can schedule the applet. */ - cs_cant_get(s->csb); + cs_cant_get(s->scb); appctx_wakeup(appctx); return ACT_RET_STOP; } @@ -1462,7 +1462,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit */ 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 */ @@ -1476,13 +1476,13 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot 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; @@ -1522,35 +1522,35 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot */ 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)); } } @@ -1620,7 +1620,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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); @@ -1630,12 +1630,12 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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 @@ -1660,8 +1660,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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); @@ -1681,27 +1681,27 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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)) @@ -1716,10 +1716,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) (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; } } @@ -1735,10 +1735,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) * 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)) @@ -1754,11 +1754,11 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) * 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); @@ -1774,11 +1774,11 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) } } - 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); @@ -1798,18 +1798,18 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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 @@ -1818,17 +1818,17 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) */ } - 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. @@ -1838,8 +1838,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) (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)); } } @@ -1847,8 +1847,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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) { @@ -1869,8 +1869,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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)); } } @@ -1886,12 +1886,12 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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; @@ -1966,8 +1966,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) } } - 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; @@ -1987,12 +1987,12 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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; @@ -2035,8 +2035,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) } } - 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; @@ -2108,8 +2108,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) * 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)); @@ -2173,7 +2173,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) */ 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 @@ -2207,10 +2207,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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) && @@ -2226,14 +2226,14 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) * - 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) && @@ -2242,7 +2242,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) } } 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); } @@ -2252,7 +2252,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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)) @@ -2264,30 +2264,30 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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 @@ -2301,7 +2301,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) */ 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); } @@ -2309,8 +2309,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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 */ @@ -2320,16 +2320,16 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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 */ @@ -2345,7 +2345,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) */ 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 @@ -2401,10 +2401,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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) && @@ -2416,7 +2416,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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 @@ -2435,7 +2435,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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 */ @@ -2445,15 +2445,15 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) /* 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) @@ -2466,10 +2466,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) 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); @@ -2527,8 +2527,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) (!(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)); } @@ -2730,7 +2730,7 @@ void stream_shutdown(struct stream *stream, int why) */ 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; @@ -2753,17 +2753,17 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, ch 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; @@ -2774,7 +2774,7 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, ch "%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" @@ -2784,7 +2784,7 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, ch (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, @@ -3154,7 +3154,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm { 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]; @@ -3242,7 +3242,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm 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: @@ -3304,20 +3304,20 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm 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)); @@ -3330,7 +3330,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm 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, @@ -3343,20 +3343,20 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm (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)); @@ -3369,7 +3369,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm 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, @@ -3679,18 +3679,18 @@ static int cli_io_handler_dump_sess(struct appctx *appctx) 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, diff --git a/src/tcp_act.c b/src/tcp_act.c index 354dbc95a..047cded57 100644 --- a/src/tcp_act.c +++ b/src/tcp_act.c @@ -67,9 +67,9 @@ static enum act_return tcp_action_req_set_src(struct act_rule *rule, struct prox 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: @@ -123,9 +123,9 @@ static enum act_return tcp_action_req_set_dst(struct act_rule *rule, struct prox 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: @@ -180,9 +180,9 @@ static enum act_return tcp_action_req_set_src_port(struct act_rule *rule, struct 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: @@ -235,9 +235,9 @@ static enum act_return tcp_action_req_set_dst_port(struct act_rule *rule, struct 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: @@ -287,7 +287,7 @@ static enum act_return tcp_exec_action_silent_drop(struct act_rule *rule, struct * 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; diff --git a/src/tcp_sample.c b/src/tcp_sample.c index 79c8056ee..d313d5dbf 100644 --- a/src/tcp_sample.c +++ b/src/tcp_sample.c @@ -53,7 +53,7 @@ smp_fetch_src(const struct arg *args, struct sample *smp, const char *kw, void * 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); } @@ -64,7 +64,7 @@ smp_fetch_src(const struct arg *args, struct sample *smp, const char *kw, void * 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; @@ -97,7 +97,7 @@ smp_fetch_sport(const struct arg *args, struct sample *smp, const char *kw, void 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); } @@ -108,7 +108,7 @@ smp_fetch_sport(const struct arg *args, struct sample *smp, const char *kw, void 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; @@ -132,7 +132,7 @@ smp_fetch_dst(const struct arg *args, struct sample *smp, const char *kw, void * 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); } @@ -143,7 +143,7 @@ smp_fetch_dst(const struct arg *args, struct sample *smp, const char *kw, void * 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; @@ -180,7 +180,7 @@ int smp_fetch_dst_is_local(const struct arg *args, struct sample *smp, const cha 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; @@ -206,7 +206,7 @@ int smp_fetch_src_is_local(const struct arg *args, struct sample *smp, const cha 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; @@ -228,7 +228,7 @@ smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void 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); } @@ -239,7 +239,7 @@ smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void 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; @@ -325,7 +325,7 @@ static inline int get_tcp_info(const struct arg *args, struct sample *smp, * 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;