MINOR: stream: Add pointer to front/back conn-streams into stream struct
frontend and backend conn-streams are now directly accesible from the
stream. This way, and with some other changes, it will be possible to remove
the stream-interfaces from the stream structure.
diff --git a/src/backend.c b/src/backend.c
index 8367a8e..34b53af 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1496,7 +1496,7 @@
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;
}
@@ -1679,7 +1679,7 @@
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;
}
@@ -1741,7 +1741,7 @@
* 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
@@ -1750,7 +1750,7 @@
* 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) {
@@ -1767,7 +1767,7 @@
* 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 */
@@ -2076,7 +2076,7 @@
*/
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;
@@ -2085,7 +2085,7 @@
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));
@@ -2211,7 +2211,7 @@
*/
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);
@@ -2220,7 +2220,7 @@
/* 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);