]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: get rid of si_takeover_conn()
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Oct 2013 17:43:37 +0000 (19:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:23 +0000 (15:40 +0100)
Since last commit, this function is an exact copy of si_prepare_conn().

include/proto/stream_interface.h
src/session.c

index 3349ddec2a3dbd975f2f6a785dcf328eeb7cc8c1..1439a037136feb067d79dadfac5a802b3b4093b1 100644 (file)
@@ -53,24 +53,12 @@ static inline void si_prepare_none(struct stream_interface *si)
        si->appctx.applet = NULL;
 }
 
-/* Assign the stream interface's pre-allocated connection to the end point,
- * and initialize the connection's context. This is used for outgoing
- * connections.
- */
-static inline void si_prepare_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
-{
-       struct connection *conn = si->conn;
-
-       si->ops = &si_conn_ops;
-       si->end = &conn->obj_type;
-       conn_assign(conn, &si_conn_cb, ctrl, xprt, si);
-}
-
 /* Assign the stream interface's pre-allocated connection to the end point,
  * and leave the connection's context untouched. This is used for incoming
- * connections.
+ * and outgoing connections. The caller is responsible for ensuring that
+ * si->conn already points to the connection.
  */
-static inline void si_takeover_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
+static inline void si_prepare_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
 {
        struct connection *conn = si->conn;
 
index b8b5b4980eaad913201b9336768a8706a03a954e..e509662794b2c020a1178a2fab1993f52e85fc53 100644 (file)
@@ -426,7 +426,7 @@ int session_complete(struct session *s)
 
        /* attach the incoming connection to the stream interface now */
        s->si[0].conn = conn;
-       si_takeover_conn(&s->si[0], l->proto, l->xprt);
+       si_prepare_conn(&s->si[0], l->proto, l->xprt);
 
        s->flags |= SN_INITIALIZED;
        s->unique_id = NULL;