]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: peers: delay appctx initialization
authorWilly Tarreau <w@1wt.eu>
Sun, 1 Dec 2013 11:54:55 +0000 (12:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:23 +0000 (15:40 +0100)
Now that the session handler can automatically initialize the appctx,
let's not do it in peers_accept() anymore.

src/peers.c

index 234c4b99897ee5b2611fc177f5040239570045c7..0d06505d618d1789bc1b3f6453cd91b34d0ad1d3 100644 (file)
@@ -1089,14 +1089,8 @@ static void peer_session_forceshutdown(struct session * session)
  */
 int peer_accept(struct session *s)
 {
-       struct appctx *appctx;
-
        s->target = &peer_applet.obj_type;
-       appctx = stream_int_register_handler(&s->si[1], objt_applet(s->target));
-       if (!appctx)
-               return -1;
-       appctx->st0 = PEER_SESS_ST_ACCEPT;
-       appctx->ctx.peers.ptr = s;
+       /* no need to initialize the applet, it will start with st0=st1 = 0 */
 
        tv_zero(&s->logs.tv_request);
        s->logs.t_queue = 0;