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 b2b7ba5..f7e5dbd 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1178,22 +1178,20 @@
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));