]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux: register the pass-through mux for any ALPN string
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Sep 2017 17:43:21 +0000 (19:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:03:23 +0000 (18:03 +0100)
The pass-through mux is the fallback used on any incoming connection
unless another mux claims the ALPN name and the proxy mode. Thus mux_pt
registers ALPN token "" (empty name) which catches everything.

src/mux_pt.c

index 603c3603eadc1601abd16fda54a0d43009bd3024..64aae14bade639573f2a4bef90b3548e9b33d0b7 100644 (file)
@@ -59,3 +59,13 @@ const struct mux_ops mux_pt_ops = {
        .wake = mux_pt_wake,
        .name = "PASS",
 };
+
+/* ALPN selection : default mux has empty name */
+static struct alpn_mux_list alpn_mux_pt =
+       { .token = IST(""), .mode = ALPN_MODE_ANY, .mux = &mux_pt_ops };
+
+__attribute__((constructor))
+static void __mux_pt_init(void)
+{
+       alpn_register_mux(&alpn_mux_pt);
+}