MEDIUM: servers: Store the connection in the SI until we have a mux.
When we create a connection, if we have to defer the conn_stream and the
mux creation until we can decide it (ie until the SSL handshake is done, and
the ALPN is decided), store the connection in the stream_interface, so that
we're sure we can destroy it if needed.
diff --git a/src/backend.c b/src/backend.c
index 3ab450b..cdc63c6 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1279,9 +1279,10 @@
/* Store the connection into the stream interface,
* while we still don't have a mux, so that if the
* stream is destroyed before the connection is
- * established, and a mux is set, we don't attempt
- * to access the stream
+ * established, we have a chance to destroy it even
+ * if it is no longer referenced in the session.
*/
+ s->si[1].end = &srv_conn->obj_type;
conn_set_xprt_done_cb(srv_conn, conn_complete_server);
}