On Thu, Jan 17, 2019 at 03:09:20PM +0000, Luke Seelenbinder wrote:
> Hi Oliver,
> 
> Yes! I can confirm the patch does indeed work—thanks for the quick turnaround.
> 
> Best,
> Luke
> 

Willy, can you push it ?

Thanks !

Olivier
>From 585bcc7f8ec84573d070d2d9d1e0b104fd18eb48 Mon Sep 17 00:00:00 2001
From: Olivier Houchard <ohouch...@haproxy.com>
Date: Thu, 17 Jan 2019 15:59:13 +0100
Subject: [PATCH] BUG/MEDIUM: servers: Make assign_tproxy_address work when
 ALPN is set.

If an ALPN is set on the server line, then when we reach assign_tproxy_address,
the stream_interface's endpoint will be a connection, not a conn_stream,
so make sure assign_tproxy_address() handles both cases.

This should be backported to 1.9.
---
 src/backend.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/backend.c b/src/backend.c
index ab5a629c..3e327975 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1021,7 +1021,12 @@ static void assign_tproxy_address(struct stream *s)
        struct server *srv = objt_server(s->target);
        struct conn_src *src;
        struct connection *cli_conn;
-       struct connection *srv_conn = cs_conn(objt_cs(s->si[1].end));
+       struct connection *srv_conn;
+
+       if (objt_cs(s->si[1].end))
+               srv_conn = cs_conn(__objt_cs(s->si[1].end));
+       else
+               srv_conn = objt_conn(s->si[1].end);
 
        if (srv && srv->conn_src.opts & CO_SRC_BIND)
                src = &srv->conn_src;
-- 
2.19.1

Reply via email to