]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Don't rely on the stream anymore in h1_set_srv_conn_mode()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 22 Nov 2018 09:19:50 +0000 (10:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 16:37:27 +0000 (17:37 +0100)
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

src/mux_h1.c

index a2184a97077f4393ad33d53ec31a5b601ab0df20..c95cd90e7b8452adc3c26feb7299f8ef0dc0393d 100644 (file)
@@ -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 */