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 0390772..547c671 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);
 }