]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: session: call the socket layer init function when a session establishes
authorWilly Tarreau <w@1wt.eu>
Sat, 12 May 2012 06:08:09 +0000 (08:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 May 2012 06:09:27 +0000 (08:09 +0200)
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.

src/session.c

index cd80b8a155b9d9cf4d686da3041210c672f17f73..088b43663102e23d75c9f1d2e4f5b1adb531e43f 100644 (file)
@@ -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.