]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: backend: set the connection owner to the session when using alpn.
authorOlivier Houchard <cognet@ci0.org>
Tue, 26 May 2020 23:26:06 +0000 (01:26 +0200)
committerOlivier Houchard <cognet@ci0.org>
Tue, 26 May 2020 23:34:33 +0000 (01:34 +0200)
In connect_server(), if we can't create the mux immediately because we have
to wait until the alpn is negociated, store the session as the connection's
owner. conn_create_mux() expects it to be set, and provides it to the mux
init() method. Failure to do so will result to crashes later if the
connection is private, and even if we didn't do so it would prevent connection
reuse for private connections.
This should fix github issue #651.

src/backend.c

index 2a592473047dc45a023e586da89cede851ff2617..ba968198e88122bc1a1ae6c4eb86dda2b9291ee0 100644 (file)
@@ -1407,6 +1407,10 @@ int connect_server(struct stream *s)
                    srv->mux_proto || s->be->mode != PR_MODE_HTTP))
 #endif
                        init_mux = 1;
+#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
+               else
+                       srv_conn->owner = s->sess;
+#endif
                /* process the case where the server requires the PROXY protocol to be sent */
                srv_conn->send_proxy_ofs = 0;