From: Christopher Faulet Date: Mon, 22 Mar 2021 16:06:24 +0000 (+0100) Subject: MINOR: muxes: Show muxes flags when the mux list is displayed X-Git-Tag: v2.4-dev15~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb69d781c82fc52a7d21bd162dcbcbebf7b879fb;p=thirdparty%2Fhaproxy.git MINOR: muxes: Show muxes flags when the mux list is displayed When the mux list is displayed on "haproxy -vv" output, the mux flags are now diplayed. The flags meaning may be found in the configuration manual. --- diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index 4f03aef707..bccb1abee3 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -928,6 +929,7 @@ static inline struct mux_proto_list *get_mux_proto(const struct ist proto) static inline void list_mux_proto(FILE *out) { struct mux_proto_list *item; + struct buffer *chk = get_trash_chunk(); struct ist proto; char *mode, *side; @@ -954,8 +956,19 @@ static inline void list_mux_proto(FILE *out) else side = "NONE"; - fprintf(out, " %15s : mode=%-10s side=%-8s mux=%s\n", - (proto.len ? proto.ptr : ""), mode, side, item->mux->name); + chunk_reset(chk); + if (item->mux->flags & MX_FL_HTX) + chunk_strcpy(chk, "HTX"); + if (item->mux->flags & MX_FL_CLEAN_ABRT) + chunk_appendf(chk, "%sCLEAN_ABRT", (b_data(chk) ? "|": "")); + if (item->mux->flags & MX_FL_HOL_RISK) + chunk_appendf(chk, "%sHOL_RISK", (b_data(chk) ? "|": "")); + if (item->mux->flags & MX_FL_NO_UPG) + chunk_appendf(chk, "%sNO_UPG", (b_data(chk) ? "|": "")); + + fprintf(out, " %15s : mode=%-10s side=%-8s mux=%-8s flags=%.*s\n", + (proto.len ? proto.ptr : ""), mode, side, item->mux->name, + (int)b_data(chk), b_orig(chk)); } }