]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: connection: move list_mux_proto() to connection.c
authorWilly Tarreau <w@1wt.eu>
Sat, 8 May 2021 12:06:09 +0000 (14:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 8 May 2021 18:24:09 +0000 (20:24 +0200)
No idea why this was put inlined into connection.h, it's used only once
for haproxy -vv, and requires tools.h, causing an undesired dependency
from connection.h. Let's move it to connection.c instead where it ought
to have been.

include/haproxy/connection.h
src/connection.c

index b0b855e2c07ea076588ec57d6736b5bed71f143d..aeef840a6ece4a0373d7cb22097f5bf937cb95d6 100644 (file)
@@ -929,53 +929,7 @@ static inline struct mux_proto_list *get_mux_proto(const struct ist proto)
        return NULL;
 }
 
-/* Lists the known proto mux on <out> */
-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;
-
-       fprintf(out, "Available multiplexer protocols :\n"
-               "(protocols marked as <default> cannot be specified using 'proto' keyword)\n");
-       list_for_each_entry(item, &mux_proto_list.list, list) {
-               proto = item->token;
-
-               if (item->mode == PROTO_MODE_ANY)
-                       mode = "TCP|HTTP";
-               else if (item->mode == PROTO_MODE_TCP)
-                       mode = "TCP";
-               else if (item->mode == PROTO_MODE_HTTP)
-                       mode = "HTTP";
-               else
-                       mode = "NONE";
-
-               if (item->side == PROTO_SIDE_BOTH)
-                       side = "FE|BE";
-               else if (item->side == PROTO_SIDE_FE)
-                       side = "FE";
-               else if (item->side == PROTO_SIDE_BE)
-                       side = "BE";
-               else
-                       side = "NONE";
-
-               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 : "<default>"), mode, side, item->mux->name,
-                       (int)b_data(chk), b_orig(chk));
-       }
-}
-
+void list_mux_proto(FILE *out);
 /* returns the first mux entry in the list matching the exact same <mux_proto>
  * and compatible with the <proto_side> (FE or BE) and the <proto_mode> (TCP or
  * HTTP). <mux_proto> can be empty. Will fall back to the first compatible mux
index 3e3fb007f8e09cbf6511e21a73d509a65d6b0609..73a326dd570e45e02dc01d2573b4c30012e0cce5 100644 (file)
@@ -987,6 +987,53 @@ int conn_recv_socks4_proxy_response(struct connection *conn)
        return 0;
 }
 
+/* Lists the known proto mux on <out> */
+void list_mux_proto(FILE *out)
+{
+       struct mux_proto_list *item;
+       struct buffer *chk = get_trash_chunk();
+       struct ist proto;
+       char *mode, *side;
+
+       fprintf(out, "Available multiplexer protocols :\n"
+               "(protocols marked as <default> cannot be specified using 'proto' keyword)\n");
+       list_for_each_entry(item, &mux_proto_list.list, list) {
+               proto = item->token;
+
+               if (item->mode == PROTO_MODE_ANY)
+                       mode = "TCP|HTTP";
+               else if (item->mode == PROTO_MODE_TCP)
+                       mode = "TCP";
+               else if (item->mode == PROTO_MODE_HTTP)
+                       mode = "HTTP";
+               else
+                       mode = "NONE";
+
+               if (item->side == PROTO_SIDE_BOTH)
+                       side = "FE|BE";
+               else if (item->side == PROTO_SIDE_FE)
+                       side = "FE";
+               else if (item->side == PROTO_SIDE_BE)
+                       side = "BE";
+               else
+                       side = "NONE";
+
+               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 : "<default>"), mode, side, item->mux->name,
+                       (int)b_data(chk), b_orig(chk));
+       }
+}
+
 /* Note: <remote> is explicitly allowed to be NULL */
 int make_proxy_line(char *buf, int buf_len, struct server *srv, struct connection *remote, struct stream *strm)
 {