]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: shows correct mode in "show sess"
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 8 Mar 2022 11:05:31 +0000 (12:05 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 8 Mar 2022 11:21:36 +0000 (12:21 +0100)
The "show sess" cli command only handles "http" or "tcp" as a fallback
mode, replace this by a call to proxy_mode_str() to show all the modes.

Could be backported in every maintained versions.

src/stream.c

index aacbc35d2c3303e613479b190ddd3ffbb8e126f6..675688a089ca897188c3ef79426381d0f27adc11 100644 (file)
@@ -3149,7 +3149,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
 
                chunk_appendf(&trash,
                             "  frontend=%s (id=%u mode=%s), listener=%s (id=%u)",
-                            strm_fe(strm)->id, strm_fe(strm)->uuid, strm_fe(strm)->mode ? "http" : "tcp",
+                            strm_fe(strm)->id, strm_fe(strm)->uuid, proxy_mode_str(strm_fe(strm)->mode),
                             strm_li(strm) ? strm_li(strm)->name ? strm_li(strm)->name : "?" : "?",
                             strm_li(strm) ? strm_li(strm)->luid : 0);
 
@@ -3172,7 +3172,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                        chunk_appendf(&trash,
                                     "  backend=%s (id=%u mode=%s)",
                                     strm->be->id,
-                                    strm->be->uuid, strm->be->mode ? "http" : "tcp");
+                                    strm->be->uuid, proxy_mode_str(strm->be->mode));
                else
                        chunk_appendf(&trash, "  backend=<NONE> (id=-1 mode=-)");