From: Christopher Faulet Date: Wed, 28 Feb 2018 09:33:34 +0000 (+0100) Subject: CLEANUP: backend: Move mux install to call it at only one place X-Git-Tag: v1.9-dev2~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bf88c05d0b642c6acef554acf6b668781c0985f;p=thirdparty%2Fhaproxy.git CLEANUP: backend: Move mux install to call it at only one place It makes the code readability simpler. It will also ease futur changes. --- diff --git a/src/backend.c b/src/backend.c index b2b7ba580c..f7e5dbddfd 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1178,22 +1178,20 @@ int connect_server(struct stream *s) srv_conn->target = s->target; /* set the correct protocol on the output stream interface */ - if (srv) { + if (srv) conn_prepare(srv_conn, protocol_by_family(srv_conn->addr.to.ss_family), srv->xprt); - /* XXX: Pick the right mux, when we finally have one */ - conn_install_mux(srv_conn, &mux_pt_ops, srv_cs); - } else if (obj_type(s->target) == OBJ_TYPE_PROXY) { /* proxies exclusively run on raw_sock right now */ conn_prepare(srv_conn, protocol_by_family(srv_conn->addr.to.ss_family), xprt_get(XPRT_RAW)); if (!objt_cs(s->si[1].end) || !objt_cs(s->si[1].end)->conn->ctrl) return SF_ERR_INTERNAL; - /* XXX: Pick the right mux, when we finally have one */ - conn_install_mux(srv_conn, &mux_pt_ops, srv_cs); } else return SF_ERR_INTERNAL; /* how did we get there ? */ + /* XXX: Pick the right mux, when we finally have one */ + conn_install_mux(srv_conn, &mux_pt_ops, srv_cs); + /* process the case where the server requires the PROXY protocol to be sent */ srv_conn->send_proxy_ofs = 0; cli_conn = objt_conn(strm_orig(s));