]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: make proxy_type_str() recognize peers sections
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Apr 2023 22:04:36 +0000 (00:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 23 Apr 2023 07:46:15 +0000 (09:46 +0200)
Now proxy_type_str() will emit "peers section" when the mode is set to
peers, so as to ease sharing more code between peers and proxies.

include/haproxy/proxy.h

index 039077242c781b8bbc23e22735157d5d3a593413..547c6718fa1b9a6963ba0d55d4f59c13ebdebadb 100644 (file)
@@ -92,6 +92,8 @@ struct proxy *cli_find_frontend(struct appctx *appctx, const char *arg);
  */
 static inline const char *proxy_type_str(struct proxy *proxy)
 {
+       if (proxy->mode == PR_MODE_PEERS)
+               return "peers section";
        return proxy_cap_str(proxy->cap);
 }