diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h index eaacaa47e..3981fcb3e 100644 --- a/include/haproxy/conn_stream-t.h +++ b/include/haproxy/conn_stream-t.h @@ -26,8 +26,6 @@ #include #include -struct stream_interface; - /* CS endpoint flags */ enum { CS_EP_NONE = 0x00000000, /* For initialization purposes */ @@ -175,7 +173,6 @@ struct conn_stream { struct wait_event wait_event; /* We're in a wait list */ struct cs_endpoint *endp; /* points to the end point (MUX stream or appctx) */ enum obj_type *app; /* points to the applicative point (stream or check) */ - struct stream_interface *si; const struct data_cb *data_cb; /* data layer callbacks. Must be set before xprt->init() */ struct cs_app_ops *ops; /* general operations used at the app layer */ struct sockaddr_storage *src; /* source address (pool), when known, otherwise NULL */ diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index 9dd064eb9..ec8823584 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -31,7 +31,6 @@ struct buffer; struct session; struct appctx; struct stream; -struct stream_interface; struct check; #define IS_HTX_CS(cs) (cs_conn(cs) && IS_HTX_CONN(__cs_conn(cs))) @@ -132,6 +131,7 @@ static inline struct stream *__cs_strm(const struct conn_stream *cs) { return __objt_stream(cs->app); } + static inline struct stream *cs_strm(const struct conn_stream *cs) { if (obj_type(cs->app) == OBJ_TYPE_STREAM) @@ -153,15 +153,6 @@ static inline struct check *cs_check(const struct conn_stream *cs) return __objt_check(cs->app); return NULL; } - -/* Returns the stream-interface from a cs. It is not NULL only if a stream is - * attached to the cs. - */ -static inline struct stream_interface *cs_si(const struct conn_stream *cs) -{ - return cs->si; -} - static inline const char *cs_get_data_name(const struct conn_stream *cs) { if (!cs->data_cb) diff --git a/src/cli.c b/src/cli.c index ff1610e6a..1832ff75e 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2767,7 +2767,6 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) sockaddr_free(&s->csb->dst); cs_set_state(s->csb, CS_ST_INI); - cs_si(s->csb)->flags &= SI_FL_ISBACK; /* we're in the context of process_stream */ s->csb->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); diff --git a/src/conn_stream.c b/src/conn_stream.c index c4dd8ab8d..c3621450c 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -19,7 +19,6 @@ #include #include #include -#include DECLARE_POOL(pool_head_connstream, "conn_stream", sizeof(struct conn_stream)); DECLARE_POOL(pool_head_cs_endpoint, "cs_endpoint", sizeof(struct cs_endpoint)); @@ -124,7 +123,6 @@ struct conn_stream *cs_new(struct cs_endpoint *endp) cs->state = CS_ST_INI; cs->hcto = TICK_ETERNITY; cs->app = NULL; - cs->si = NULL; cs->data_cb = NULL; cs->src = NULL; cs->dst = NULL; @@ -186,12 +184,6 @@ struct conn_stream *cs_new_from_strm(struct stream *strm, unsigned int flags) return NULL; cs->flags |= flags; cs->endp->flags |= CS_EP_DETACHED; - cs->si = si_new(cs); - if (unlikely(!cs->si)) { - cs_free(cs); - return NULL; - } - cs->app = &strm->obj_type; cs->ops = &cs_app_embedded_ops; cs->data_cb = NULL; @@ -217,7 +209,6 @@ struct conn_stream *cs_new_from_check(struct check *check, unsigned int flags) */ void cs_free(struct conn_stream *cs) { - si_free(cs->si); sockaddr_free(&cs->src); sockaddr_free(&cs->dst); if (cs->endp) { @@ -279,19 +270,11 @@ void cs_attach_applet(struct conn_stream *cs, void *target, void *ctx) int cs_attach_strm(struct conn_stream *cs, struct stream *strm) { cs->app = &strm->obj_type; - - cs->si = si_new(cs); - if (unlikely(!cs->si)) - return -1; - cs->endp->flags &= ~CS_EP_ORPHAN; if (cs->endp->flags & CS_EP_T_MUX) { cs->wait_event.tasklet = tasklet_new(); - if (!cs->wait_event.tasklet) { - si_free(cs->si); - cs->si = NULL; + if (!cs->wait_event.tasklet) return -1; - } cs->wait_event.tasklet->process = cs_conn_io_cb; cs->wait_event.tasklet->context = cs; cs->wait_event.events = 0; @@ -363,7 +346,7 @@ void cs_detach_endp(struct conn_stream *cs) * connection related for now but this will evolved */ cs->flags &= CS_FL_ISBACK; - if (cs->si) + if (cs_strm(cs)) cs->ops = &cs_app_embedded_ops; cs->data_cb = NULL; @@ -373,9 +356,7 @@ void cs_detach_endp(struct conn_stream *cs) void cs_detach_app(struct conn_stream *cs) { - si_free(cs->si); cs->app = NULL; - cs->si = NULL; cs->data_cb = NULL; sockaddr_free(&cs->src); sockaddr_free(&cs->dst); diff --git a/src/debug.c b/src/debug.c index 62efca611..0075db67f 100644 --- a/src/debug.c +++ b/src/debug.c @@ -693,7 +693,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 { | wake }*\n" - " = {strm | strm.f | strm.x | sif.f | csf.s | sib.f | csb.s |\n" + " = {strm | strm.f | strm.x | csf.s | csb.s |\n" " txn.f | req.f | req.r | req.w | res.f | res.r | res.w}\n" " = {'' (show) | '=' (assign) | '^' (xor) | '+' (or) | '-' (andnot)}\n" " = 'now' | 64-bit dec/hex integer (0x prefix supported)\n" @@ -728,10 +728,6 @@ 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("sif.f"))) { - ptr = (!s || !may_access(s)) ? NULL : &cs_si(s->csf)->flags; size = sizeof(cs_si(s->csf)->flags); - } else if (isteq(name, ist("sib.f"))) { - ptr = (!s || !may_access(s)) ? NULL : &cs_si(s->csb)->flags; size = sizeof(cs_si(s->csb)->flags); } 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"))) {