From: Christopher Faulet Date: Thu, 23 Dec 2021 13:53:08 +0000 (+0100) Subject: MINOR: conn-stream: Rename cs_detach() to cs_detach_endp() X-Git-Tag: v2.6-dev2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a73c9f0faa873bc2a1f21b54c0f7735712ef759e;p=thirdparty%2Fhaproxy.git MINOR: conn-stream: Rename cs_detach() to cs_detach_endp() Because cs_detach() is releated to the endpoint only, the function is renamed. The main purpose of this patch is to be able to add a function to detach the conn-stream from the application. --- diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index c9c3d6e4be..a89104b17e 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -110,12 +110,13 @@ static inline void cs_attach_app(struct conn_stream *cs, enum obj_type *app, voi cs->data_cb = data_cb; } -/* Detach the conn_stream from the connection, if any. If a mux owns the - * connection ->detach() callback is called. Otherwise, it means the conn-stream - * owns the connection. In this case the connection is closed and released. The - * conn-stream is not released. +/* Detach the conn_stream from the endpoint, if any. For a connecrion, if a mux + * owns the connection ->detach() callback is called. Otherwise, it means the + * conn-stream owns the connection. In this case the connection is closed and + * released. For an applet, the appctx is released. At the end, the conn-stream + * is not released but some fields a reset. */ -static inline void cs_detach(struct conn_stream *cs) +static inline void cs_detach_endp(struct conn_stream *cs) { struct connection *conn; struct appctx *appctx; @@ -150,7 +151,7 @@ static inline void cs_detach(struct conn_stream *cs) /* Release a conn_stream */ static inline void cs_destroy(struct conn_stream *cs) { - cs_detach(cs); + cs_detach_endp(cs); cs_free(cs); } diff --git a/include/haproxy/stream_interface.h b/include/haproxy/stream_interface.h index c5fd393117..5236ffd07e 100644 --- a/include/haproxy/stream_interface.h +++ b/include/haproxy/stream_interface.h @@ -148,7 +148,7 @@ static inline void si_reset_endpoint(struct stream_interface *si) if (cs_conn_mux(si->cs) && si->wait_event.events != 0) (cs_conn_mux(si->cs))->unsubscribe(si->cs, si->wait_event.events, &si->wait_event); - cs_detach(si->cs); + cs_detach_endp(si->cs); si->ops = &si_embedded_ops; }