]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream-int: remove any reference to the owner
authorWilly Tarreau <w@1wt.eu>
Fri, 28 Nov 2014 11:12:34 +0000 (12:12 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Mar 2015 19:41:46 +0000 (20:41 +0100)
si->owner is not used anymore now, so let's remove any reference to it.

include/proto/stream_interface.h
include/types/stream_interface.h
src/hlua.c
src/peers.c
src/session.c

index 584abcf6d5de117905566eb1e2d3f2d0b3dcc72e..745bbcb00fc5f070dfddb0e9331779f58086d57e 100644 (file)
@@ -124,11 +124,11 @@ static inline void appctx_free(struct appctx *appctx)
 }
 
 /* initializes a stream interface in the SI_ST_INI state. It's detached from
- * any endpoint and is only attached to an owner (generally a task).
+ * any endpoint and only keeps its side which is expected to have already been
+ * set.
  */
-static inline void si_reset(struct stream_interface *si, void *owner)
+static inline void si_reset(struct stream_interface *si)
 {
-       si->owner          = owner;
        si->err_type       = SI_ET_NONE;
        si->conn_retries   = 0;  /* used for logging too */
        si->exp            = TICK_ETERNITY;
index 9d81bbc8c62f9543858fed0a9bb97a920bdeae30..d8865d5fc5ec2090936c7494ea832d020a83bb77 100644 (file)
@@ -175,7 +175,6 @@ struct stream_interface {
        enum si_state prev_state;/* SI_ST*, copy of previous state */
        unsigned short flags;    /* SI_FL_* */
        unsigned int exp;       /* wake up time for connect, queue, turn-around, ... */
-       void *owner;            /* generally a (struct task*) */
        enum obj_type *end;     /* points to the end point (connection or appctx) */
        struct si_ops *ops;     /* general operations at the stream interface layer */
 
index af53cea677a00352f3f0825383d4d3fae56d074c..83a86836242c5a5c12864b125c08fa3e6713fe52 100644 (file)
@@ -1994,7 +1994,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
        channel_auto_close(&socket->s->req); /* let the producer forward close requests */
 
        socket->s->si[0].flags = SI_FL_NONE;
-       si_reset(&socket->s->si[0], socket->s->task);
+       si_reset(&socket->s->si[0]);
        si_set_state(&socket->s->si[0], SI_ST_EST); /* connection established (resource exists) */
 
        appctx = stream_int_register_handler(&socket->s->si[0], &update_applet);
@@ -2010,7 +2010,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
         * with the "struct server".
         */
        socket->s->si[1].flags = SI_FL_ISBACK;
-       si_reset(&socket->s->si[1], socket->s->task);
+       si_reset(&socket->s->si[1]);
        si_set_state(&socket->s->si[1], SI_ST_INI);
        socket->s->si[1].conn_retries = socket_proxy.conn_retries;
 
index b6f573e1db82e4ab30450ed8ef824b0aa931fa10..10cc7ff1d9fdc9d8475269ab53edb865ea7bbd7b 100644 (file)
@@ -1166,7 +1166,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
        s->si[0].flags = SI_FL_NONE;
        s->si[1].flags = SI_FL_ISBACK;
 
-       si_reset(&s->si[0], t);
+       si_reset(&s->si[0]);
        si_set_state(&s->si[0], SI_ST_EST);
 
        if (s->fe->options2 & PR_O2_INDEPSTR)
@@ -1178,7 +1178,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
        appctx->st0 = PEER_SESS_ST_CONNECT;
        appctx->ctx.peers.ptr = (void *)ps;
 
-       si_reset(&s->si[1], t);
+       si_reset(&s->si[1]);
 
        /* initiate an outgoing connection */
        si_set_state(&s->si[1], SI_ST_ASS);
index 7f726d42934ab395c725d2e07f5d84f04f981362..ca8efca1b94225e10e87ec6a008a6249dcecd58e 100644 (file)
@@ -458,7 +458,7 @@ int session_complete(struct session *s)
        }
 
        /* this part should be common with other protocols */
-       si_reset(&s->si[0], t);
+       si_reset(&s->si[0]);
        si_set_state(&s->si[0], SI_ST_EST);
 
        /* attach the incoming connection to the stream interface now.
@@ -474,7 +474,7 @@ int session_complete(struct session *s)
        /* pre-initialize the other side's stream interface to an INIT state. The
         * callbacks will be initialized before attempting to connect.
         */
-       si_reset(&s->si[1], t);
+       si_reset(&s->si[1]);
        si_detach(&s->si[1]);
 
        if (likely(s->fe->options2 & PR_O2_INDEPSTR))