From: Christopher Faulet Date: Thu, 22 Nov 2018 09:19:50 +0000 (+0100) Subject: MINOR: mux-h1: Don't rely on the stream anymore in h1_set_srv_conn_mode() X-Git-Tag: v1.9-dev9~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1692f51a508f86d82474cf8353f598a6cc8ee2b;p=thirdparty%2Fhaproxy.git MINOR: mux-h1: Don't rely on the stream anymore in h1_set_srv_conn_mode() In h1_set_srv_conn_mode(), we need to get the frontend proxy of a server connection. untill now, we relied on the stream to get it. But it was a bit dirty. The stream always exists at this stage but to get it, we also need to get the stream-interface. Since the commit 7c6f8b146 ("MAJOR: connections: Detach connections from streams."), the connection's owner is always the session, even for outgoing connections. So now, we rely on the session to get the frontend proxy in h1_set_srv_conn_mode(). Use the session instead of the stream to get the frontend on the server connection --- diff --git a/src/mux_h1.c b/src/mux_h1.c index a2184a9707..c95cd90e7b 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -594,8 +594,10 @@ static void h1_set_cli_conn_mode(struct h1s *h1s, struct h1m *h1m) */ static void h1_set_srv_conn_mode(struct h1s *h1s, struct h1m *h1m) { - struct proxy *be = h1s->h1c->px; - struct proxy *fe = strm_fe(si_strm(h1s->cs->data)); + struct h1c *h1c = h1s->h1c; + struct session *sess = h1c->conn->owner; + struct proxy *fe = sess->fe; + struct proxy *be = h1c->px; int flag = H1S_F_WANT_KAL; /* Tunnel mode can only by set on the frontend */