From: Willy Tarreau Date: Wed, 10 May 2023 15:18:15 +0000 (+0200) Subject: DEV: flags: add missing stream flags to show-sess-to-flags X-Git-Tag: v2.8-dev11~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=058f246fc55df9fbba759bd6d41519db042fdb82;p=thirdparty%2Fhaproxy.git DEV: flags: add missing stream flags to show-sess-to-flags I managed to miss strm.flg which appears at the top, in part because there was no "stream" context. Let's create one and decode the flags. --- diff --git a/dev/flags/show-sess-to-flags.sh b/dev/flags/show-sess-to-flags.sh index 14f589c0ff..d81efc2d8f 100755 --- a/dev/flags/show-sess-to-flags.sh +++ b/dev/flags/show-sess-to-flags.sh @@ -102,7 +102,7 @@ dump_and_reset() { ### main entry point -ctx=top +ctx=strm while read -r; do [ "$REPLY" != "EOF" ] || break # for debugging @@ -129,10 +129,12 @@ while read -r; do elif [[ "$REPLY" =~ ^0x ]]; then # here we dump what we have and we reset dump_and_reset - ctx=top; + ctx=strm; fi - if [ $ctx = task ]; then + if [ $ctx = strm ]; then + ! [[ "$REPLY" =~ [[:blank:]]flags=([^[:blank:]]*) ]] || append_flag strm.flg strm "${BASH_REMATCH[1]}" + elif [ $ctx = task ]; then ! [[ "$REPLY" =~ \(state=([^[:blank:]]*) ]] || append_flag task.state task "${BASH_REMATCH[1]}" elif [ $ctx = txn ]; then ! [[ "$REPLY" =~ [[:blank:]]meth=([^[:blank:]]*) ]] || append_str txn.meth "${BASH_REMATCH[1]}" "${HTTP_METH[$((${BASH_REMATCH[1]}))]}"