diff --git a/src/stream_interface.c b/src/stream_interface.c index 987fc016b..ca0519741 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -340,7 +340,11 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag) const struct conn_stream *cs; int ret; - cs = cs_get_first(conn); + /* If there is no mux attached to the connection, it means the + * connection context is a conn-stream. + */ + cs = (conn->mux ? cs_get_first(conn) : conn->ctx); + /* The target server expects a PROXY line to be sent first. * If the send_proxy_ofs is negative, it corresponds to the * offset to start sending from then end of the proxy string @@ -360,22 +364,6 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag) objt_server(conn->target), remote_cs ? remote_cs->conn : NULL, strm); - /* We may not have a conn_stream yet, if we don't - * know which mux to use, because it will be decided - * during the SSL handshake. In this case, there should - * be a session associated to the connection in - * conn->owner, and we know it is the session that - * initiated that connection, so we can just use - * its origin, which should contain the client - * connection. - */ - } else if (!cs && conn->owner) { - struct session *sess = conn->owner; - - ret = make_proxy_line(trash.area, trash.size, - objt_server(conn->target), - objt_conn(sess->origin), - NULL); } else { /* The target server expects a LOCAL line to be sent first. Retrieving