]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn-stream: Rename cs_detach() to cs_detach_endp()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Dec 2021 13:53:08 +0000 (14:53 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Feb 2022 10:00:02 +0000 (11:00 +0100)
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.

include/haproxy/conn_stream.h
include/haproxy/stream_interface.h

index c9c3d6e4be1f7478a6f3a2bd3e7d3990e5c63976..a89104b17e2a09687315940b0a412586eb032c2f 100644 (file)
@@ -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);
 }
 
index c5fd3931179446dafc92b28b0dd8c77452ddf2a5..5236ffd07ebb8287d94de5cb8ce9124a96a864cf 100644 (file)
@@ -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;
 }