appctx->applet->release(appctx);
appctx_free(appctx);
}
- cs_init(cs);
+
+ /* Rest CS */
+ cs->flags = CS_FL_NONE;
+ cs->end = NULL;
+ cs->ctx = NULL;
+ cs->data_cb = NULL;
}
/* Release a conn_stream */
#define PCLI_F_PROMPT 0x10000
#define PCLI_F_PAYLOAD 0x20000
+struct conn_stream;
struct hlua;
struct proxy;
struct pendconn;
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 conn_stream *csf; /* frontend conn-stream */
+ struct conn_stream *csb; /* backend conn-stream */
+
struct stream_interface si[2]; /* client and server stream interfaces */
struct strm_logs logs; /* logs for this stream */
if (avail >= 1) {
si_attach_conn(&s->si[1], srv_conn);
- if (srv_conn->mux->attach(srv_conn, s->si[1].cs, s->sess) == -1) {
+ if (srv_conn->mux->attach(srv_conn, s->csb, s->sess) == -1) {
si_reset_endpoint(&s->si[1]);
srv_conn = NULL;
}
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->si[1].cs, s->sess, alt_mux) < 0) {
+ if (conn_install_mux_be(srv_conn, s->csb, s->sess, alt_mux) < 0) {
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
* sockets, socket pairs, and occasionally TCP connections on the
* loopback on a heavily loaded system.
*/
- if ((srv_conn->flags & CO_FL_ERROR || (s->si[1].cs)->flags & CS_FL_ERROR))
+ if ((srv_conn->flags & CO_FL_ERROR || s->csb->flags & CS_FL_ERROR))
s->si[1].flags |= SI_FL_ERR;
/* If we had early data, and the handshake ended, then
* the handshake.
*/
if (!(srv_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)))
- (s->si[1].cs)->flags &= ~CS_FL_WAIT_FOR_HS;
+ s->csb->flags &= ~CS_FL_WAIT_FOR_HS;
if (!si_state_in(s->si[1].state, SI_SB_EST|SI_SB_DIS|SI_SB_CLO) &&
(srv_conn->flags & CO_FL_WAIT_XPRT) == 0) {
* wake callback. Otherwise si_cs_recv()/si_cs_send() already take
* care of it.
*/
- if (((s->si[1].cs)->flags & CS_FL_EOI) && !(si_ic(&s->si[1])->flags & CF_EOI))
+ if ((s->csb->flags & CS_FL_EOI) && !(si_ic(&s->si[1])->flags & CF_EOI))
si_ic(&s->si[1])->flags |= (CF_EOI|CF_READ_PARTIAL);
/* catch all sync connect while the mux is not already installed */
*/
void back_handle_st_req(struct stream *s)
{
- struct stream_interface *si = &s->si[1];
+ struct stream_interface *si = cs_si(s->csb);
if (si->state != SI_ST_REQ)
return;
if (unlikely(obj_type(s->target) == OBJ_TYPE_APPLET)) {
/* the applet directly goes to the EST state */
- struct appctx *appctx = cs_appctx(si->cs);
+ struct appctx *appctx = cs_appctx(s->csb);
if (!appctx || appctx->applet != __objt_applet(s->target))
appctx = si_register_handler(si, objt_applet(s->target));
*/
void back_handle_st_cer(struct stream *s)
{
- struct stream_interface *si = &s->si[1];
+ struct stream_interface *si = cs_si(s->csb);
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_SI_ST, s);
/* we probably have to release last stream from the server */
if (objt_server(s->target)) {
- struct connection *conn = cs_conn(si->cs);
+ struct connection *conn = cs_conn(s->csb);
health_adjust(__objt_server(s->target), HANA_STATUS_L4_ERR);
return 0;
/* Get appctx from the stream_interface. */
- appctx = cs_appctx(smp->strm->si[1].cs);
+ appctx = cs_appctx(smp->strm->csb);
if (appctx && appctx->rule) {
cconf = appctx->rule->arg.act.p[0];
if (cconf) {
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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : NULL;
if (!conn)
return 0;
int alpn_len;
/* try to report the ALPN value when available (also works for NPN) */
- if (conn == cs_conn(s->si[0].cs)) {
+ if (conn == cs_conn(s->csf)) {
if (conn_get_alpn(conn, &alpn_str, &alpn_len) && alpn_str) {
int len = MIN(alpn_len, sizeof(alpn) - 1);
memcpy(alpn, alpn_str, len);
si = cs_si(appctx->owner);
s = si_strm(si);
- conn = cs_conn(s->si[1].cs);
+ conn = cs_conn(s->csb);
if (!conn || !conn_get_src(conn)) {
xref_unlock(&socket->xref, peer);
lua_pushnil(L);
return 2;
}
- appctx = cs_appctx(s->si[0].cs);
+ appctx = cs_appctx(s->csf);
/* Check for connection established. */
if (appctx->ctx.hlua_cosocket.connected) {
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->si[1].cs);
+ struct connection *conn = cs_conn(s->csb);
/* Perform a L7 retry because server refuses the early data. */
if ((si_b->flags & SI_FL_L7_RETRY) &&
/* 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->si[1].cs);
+ srv_conn = cs_conn(s->csb);
if (srv_conn) {
struct ist hdr;
struct http_hdr_ctx ctx;
static int http_handle_stats(struct stream *s, struct channel *req)
{
struct stats_admin_rule *stats_admin_rule;
- struct stream_interface *si = &s->si[1];
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
struct http_msg *msg = &txn->req;
struct htx *htx;
struct htx_sl *sl;
- appctx = cs_appctx(si->cs);
+ appctx = cs_appctx(s->csb);
memset(&appctx->ctx.stats, 0, sizeof(appctx->ctx.stats));
appctx->st1 = appctx->st2 = 0;
appctx->ctx.stats.st_code = STAT_STATUS_INIT;
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->si[1].cs) ? (unsigned short)(cs_conn(s->si[1].cs))->handle.fd : -1);
+ cs_conn(s->csb) ? (unsigned short)(cs_conn(s->csb))->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->si[1].cs) ? (unsigned short)(cs_conn(s->si[1].cs))->handle.fd : -1);
+ cs_conn(s->csb) ? (unsigned short)(cs_conn(s->csb))->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 conn_stream *cs = s->si[0].cs;
+ struct conn_stream *cs = s->csf;
txn = pool_alloc(pool_head_http_txn);
if (!txn)
if (likely(s)) {
be = s->be;
txn = s->txn;
- be_conn = cs_conn(s->si[1].cs);
+ be_conn = cs_conn(s->csb);
status = (txn ? txn->status : 0);
s_flags = s->flags;
uniq_id = s->uniq_id;
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
int i;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : NULL;
else
conn = objt_conn(smp->sess->origin);
SSL *ssl;
if (conn_server)
- conn = smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ conn = smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : NULL;
smp->data.type = SMP_T_BOOL;
smp->data.u.sint = (conn && conn->xprt == &ssl_sock);
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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : NULL;
if (!conn || conn->xprt != &ssl_sock)
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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : NULL;
if (!conn || conn->xprt != &ssl_sock)
return 0;
const char *sfx;
conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
- smp->strm ? cs_conn(smp->strm->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : 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->si[1].cs) : NULL;
+ smp->strm ? cs_conn(smp->strm->csb) : NULL;
smp->flags = 0;
ssl = ssl_sock_get_ssl_object(conn);
struct conn_stream *cs;
conn = objt_conn(sess->origin);
- cs = s->si[0].cs;
+ cs = s->csf;
if (conn && cs) {
if (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_SSL_WAIT_HS)) {
vars_init_head(&s->vars_txn, SCOPE_TXN);
vars_init_head(&s->vars_reqres, SCOPE_REQ);
+ s->csf = cs;
+
/* this part should be common with other protocols */
if (si_reset(&s->si[0]) < 0)
goto out_fail_alloc;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
s->si[1].flags |= SI_FL_INDEP_STR;
- s->si[1].cs = cs_new(NULL, NULL, &s->obj_type, &s->si[1], NULL);
- if (!s->si[1].cs)
+ s->csb = cs_new(NULL, NULL, &s->obj_type, &s->si[1], NULL);
+ if (!s->csb)
goto out_fail_alloc_cs;
+ s->si[1].cs = s->csb;
stream_init_srv_conn(s);
s->target = sess->listener ? sess->listener->default_target : NULL;
/* applets do not release session yet */
/* FIXME: Handle it in appctx_free ??? */
- must_free_sess = objt_appctx(sess->origin) && sess->origin == s->si[0].cs->end;
+ must_free_sess = objt_appctx(sess->origin) && sess->origin == s->csf->end;
si_release_endpoint(&s->si[1]);
*/
static void back_establish(struct stream *s)
{
- struct stream_interface *si = &s->si[1];
- struct connection *conn = cs_conn(si->cs);
+ struct connection *conn = cs_conn(s->csb);
+ struct stream_interface *si = cs_si(s->csb);
struct channel *req = &s->req;
struct channel *rep = &s->res;
return ACT_RET_ERR;
/* Initialise the context. */
- appctx = cs_appctx(s->si[1].cs);
+ appctx = cs_appctx(s->csb);
memset(&appctx->ctx, 0, sizeof(appctx->ctx));
appctx->rule = rule;
}
else
- appctx = cs_appctx(s->si[1].cs);
+ appctx = cs_appctx(s->csb);
/* Stops the applet scheduling, in case of the init function miss
* some data.
*/
int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_proto)
{
- struct conn_stream *cs = s->si[0].cs;
+ struct conn_stream *cs = s->csf;
struct connection *conn;
/* Already an HTTP stream */
else
chunk_appendf(&trash, " backend=<NONE> (id=-1 mode=-)");
- conn = cs_conn(strm->si[1].cs);
+ conn = cs_conn(strm->csb);
switch (conn && conn_get_src(conn) ? addr_to_str(conn->src, pn, sizeof(pn)) : AF_UNSPEC) {
case AF_INET:
case AF_INET6:
&strm->si[0],
si_state_str(strm->si[0].state),
strm->si[0].flags,
- obj_type_name(strm->si[0].cs->end),
- obj_base_ptr(strm->si[0].cs->end),
+ obj_type_name(strm->csf->end),
+ obj_base_ptr(strm->csf->end),
strm->si[0].exp ?
tick_is_expired(strm->si[0].exp, now_ms) ? "<PAST>" :
human_time(TICKS_TO_MS(strm->si[0].exp - now_ms),
&strm->si[1],
si_state_str(strm->si[1].state),
strm->si[1].flags,
- obj_type_name(strm->si[1].cs->end),
- obj_base_ptr(strm->si[1].cs->end),
+ obj_type_name(strm->csb->end),
+ obj_base_ptr(strm->csb->end),
strm->si[1].exp ?
tick_is_expired(strm->si[1].exp, now_ms) ? "<PAST>" :
human_time(TICKS_TO_MS(strm->si[1].exp - now_ms),
TICKS_TO_MS(1000)) : "<NEVER>",
strm->si[1].err_type, strm->si[1].wait_event.events);
- cs = strm->si[0].cs;
+ cs = strm->csf;
chunk_appendf(&trash, " cs=%p csf=0x%08x ctx=%p\n", cs, cs->flags, cs->ctx);
if ((conn = cs_conn(cs)) != NULL) {
(unsigned long long)tmpctx->t->cpu_time, (unsigned long long)tmpctx->t->lat_time);
}
- cs = strm->si[1].cs;
+ cs = strm->csb;
chunk_appendf(&trash, " cs=%p csf=0x%08x ctx=%p\n", cs, cs->flags, cs->ctx);
if ((conn = cs_conn(cs)) != NULL) {
chunk_appendf(&trash,
human_time(TICKS_TO_MS(curr_strm->res.analyse_exp - now_ms),
TICKS_TO_MS(1000)) : "");
- conn = cs_conn(curr_strm->si[0].cs);
+ conn = cs_conn(curr_strm->csf);
chunk_appendf(&trash,
" s0=[%d,%1xh,fd=%d,ex=%s]",
curr_strm->si[0].state,
human_time(TICKS_TO_MS(curr_strm->si[0].exp - now_ms),
TICKS_TO_MS(1000)) : "");
- conn = cs_conn(curr_strm->si[1].cs);
+ conn = cs_conn(curr_strm->csb);
chunk_appendf(&trash,
" s1=[%d,%1xh,fd=%d,ex=%s]",
curr_strm->si[1].state,
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->si[1].cs): NULL));
+ : (smp->strm ? cs_conn(smp->strm->csb): NULL));
if (conn && conn_get_src(conn))
src = conn_src(conn);
}
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->si[1].cs): NULL));
+ : (smp->strm ? cs_conn(smp->strm->csb): NULL));
if (conn && conn_get_src(conn))
src = conn_src(conn);
}
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->si[1].cs): NULL));
+ : (smp->strm ? cs_conn(smp->strm->csb): NULL));
if (conn && conn_get_dst(conn))
dst = conn_dst(conn);
}
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->si[1].cs): NULL));
+ : (smp->strm ? cs_conn(smp->strm->csb): NULL));
if (conn && conn_get_dst(conn))
dst = conn_dst(conn);
}
/* get the object associated with the stream interface.The
* object can be other thing than a connection. For example,
* it be a appctx. */
- conn = cs_conn(smp->strm->si[dir].cs);
+ conn = (dir == 0 ? cs_conn(smp->strm->csf) : cs_conn(smp->strm->csb));
if (!conn)
return 0;