From: Matus Fabian Date: Mon, 25 Aug 2025 17:05:02 +0000 (-0400) Subject: http: http2_format_req print stream state X-Git-Tag: v26.02-rc0~67 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=632d9f9dbaf038f75b32bf302345e1a9e7529c26;p=vpp.git http: http2_format_req print stream state instead of connection state Type: improvement Change-Id: Iaf03a3cb3f78b05d3002f0edee753797c213e651 Signed-off-by: Matus Fabian --- diff --git a/src/plugins/http/http2/http2.c b/src/plugins/http/http2/http2.c index 1a9208437a6..ba6e927b0c3 100644 --- a/src/plugins/http/http2/http2.c +++ b/src/plugins/http/http2/http2.c @@ -2645,6 +2645,25 @@ format_http2_req (u8 *s, va_list *args) return s; } +static u8 * +format_http2_stream_state (u8 *s, va_list *args) +{ + http2_stream_state_t state = va_arg (*args, http2_stream_state_t); + u8 *t = 0; + + switch (state) + { +#define _(s, str) \ + case HTTP2_STREAM_STATE_##s: \ + t = (u8 *) str; \ + break; + foreach_http2_stream_state +#undef _ + default : return format (s, "unknown"); + } + return format (s, "%s", t); +} + static u8 * http2_format_req (u8 *s, va_list *args) { @@ -2659,8 +2678,8 @@ http2_format_req (u8 *s, va_list *args) s = format (s, "%-" SESSION_CLI_ID_LEN "U", format_http2_req, req, hc); if (verbose) { - s = - format (s, "%-" SESSION_CLI_STATE_LEN "U", format_http_conn_state, hc); + s = format (s, "%-" SESSION_CLI_STATE_LEN "U", format_http2_stream_state, + req->stream_state); if (verbose > 1) s = format (s, "\n"); }