From: Willy Tarreau Date: Sat, 12 May 2012 06:08:09 +0000 (+0200) Subject: MINOR: session: call the socket layer init function when a session establishes X-Git-Tag: v1.5-dev10~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f5b6fc0903259f1d191ef18fd0bf6b45178f3d0;p=thirdparty%2Fhaproxy.git MINOR: session: call the socket layer init function when a session establishes In sess_establish, once we've prepared everythin, we can call the socket layer init function. We pass an argument for targets which have one (eg: servers). At the moment, the existing socket layers don't have init functions, but SSL will need one. --- diff --git a/src/session.c b/src/session.c index cd80b8a155..088b436631 100644 --- a/src/session.c +++ b/src/session.c @@ -717,6 +717,14 @@ static void sess_establish(struct session *s, struct stream_interface *si) rep->rto = s->be->timeout.server; } req->wex = TICK_ETERNITY; + + if (si->sock.init) { + /* initialize the socket layer if needed */ + void *arg = NULL; + if (target_srv(&s->target)) + arg = target_srv(&s->target)->sock_init_arg; + si->sock.init(si, arg); + } } /* Update stream interface status for input states SI_ST_ASS, SI_ST_QUE, SI_ST_TAR.