From: Amaury Denoyelle Date: Thu, 21 Aug 2025 15:30:10 +0000 (+0200) Subject: BUG/MINOR: connection: remove extra session_unown_conn() on reverse X-Git-Tag: v3.3-dev8~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04f05f188058e8931f203efc44f72a009bc85c0f;p=thirdparty%2Fhaproxy.git BUG/MINOR: connection: remove extra session_unown_conn() on reverse When a connection is reversed via rhttp protocol on the edge endpoint, it migrates from frontend to backend side. This operation is performed by conn_reverse(). During this transition, the conn owning session is freed as it becomes unneeded. Prior to this patch, session_unown_conn() was also called during frontend to backend migration. However, this is unnecessary as this function is only used for backend connection reuse. As such, this patch removes this unnecessary call. This does not cause any harm to the process as session_unown_conn() can handle a connection not inserted yet. However, for clarity purpose it's better to backport this patch up to 3.0. --- diff --git a/src/connection.c b/src/connection.c index ea4a0b27b..be03b0d47 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2962,7 +2962,6 @@ int conn_reverse(struct connection *conn) srv_use_conn(srv, conn); /* Free the session after detaching the connection from it. */ - session_unown_conn(sess, conn); sess->origin = NULL; session_free(sess); conn_set_owner(conn, NULL, NULL);