Skip to content

Commit

Permalink
DEV: flags: add missing stream flags to show-sess-to-flags
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wtarreau committed May 10, 2023
1 parent bd90a16 commit 058f246
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dev/flags/show-sess-to-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ dump_and_reset() {

### main entry point

ctx=top
ctx=strm
while read -r; do
[ "$REPLY" != "EOF" ] || break # for debugging

Expand All @@ -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]}))]}"
Expand Down

0 comments on commit 058f246

Please sign in to comment.