]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: set the listeners' data layer to ssl during parsing
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Sep 2012 17:11:47 +0000 (19:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Sep 2012 08:53:17 +0000 (10:53 +0200)
It's better to set all listeners to ssl_sock when seeing the "ssl"
keyword that to loop on all of them afterwards just for this. This
also removes some #ifdefs.

src/cfgparse.c
src/ssl_sock.c

index 0565cd3a9c5aa640d430868f483e63276a7afd56..7e4db74966c2417011d9b7ee5b54d7a3d34864d2 100644 (file)
@@ -6568,10 +6568,7 @@ out_uri_auth_compat:
                                        listener->name = strdup(trash);
                                }
                        }
-#ifdef USE_OPENSSL
-                       if (listener->bind_conf->is_ssl && listener->bind_conf->default_ctx)
-                               listener->data = &ssl_sock; /* SSL data layer */
-#endif
+
                        if (curproxy->options & PR_O_TCP_NOLING)
                                listener->options |= LI_O_NOLINGER;
                        if (!listener->maxconn)
index 3c997eb53472964e9fe6ca1929a295b11c5edf21..4862a9a048701501475b3a66ce4f0e1163ddb156 100644 (file)
@@ -863,7 +863,12 @@ static int bind_parse_psc(char **args, int cur_arg, struct proxy *px, struct bin
 /* parse the "ssl" bind keyword */
 static int bind_parse_ssl(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
 {
+       struct listener *l;
+
        conf->is_ssl = 1;
+       list_for_each_entry(l, &conf->listeners, by_bind)
+               l->data = &ssl_sock;
+
        return 0;
 }