From: Willy Tarreau Date: Sun, 1 Dec 2013 11:54:55 +0000 (+0100) Subject: MEDIUM: peers: delay appctx initialization X-Git-Tag: v1.5-dev20~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d7f8f77baa764e55409a12c9a8d8261a770d283;p=thirdparty%2Fhaproxy.git MEDIUM: peers: delay appctx initialization Now that the session handler can automatically initialize the appctx, let's not do it in peers_accept() anymore. --- diff --git a/src/peers.c b/src/peers.c index 234c4b9989..0d06505d61 100644 --- a/src/peers.c +++ b/src/peers.c @@ -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;