]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: report the current filter in "show sess all" when known
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 12 Oct 2021 09:02:48 +0000 (11:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 12 Oct 2021 09:26:49 +0000 (11:26 +0200)
Filters can block the stream on pre/post analysis for any reason and it can
be useful to report it in "show sess all". So now, a "current_filter" extra
line is reported for each channel if a filter is blocking the analysis. Note
that this does not catch the TCP/HTTP payload analysis because all
registered filters are always evaluated when more data are received.

src/stream.c

index 162dfaa31bd1840201682bb281d5979224bf428f..6d6374d4d7c90bff1785bda197d2eeeee9883fc2 100644 (file)
@@ -3382,6 +3382,12 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                                      (htx->tail >= htx->head) ? "NO" : "YES",
                                      (unsigned long long)htx->extra);
                }
+               if (HAS_FILTERS(strm) && strm_flt(strm)->current[0]) {
+                       struct filter *flt = strm_flt(strm)->current[0];
+
+                       chunk_appendf(&trash, "      current_filter=%p (id=\"%s\" flags=0x%x pre=0x%x post=0x%x) \n",
+                                     flt, flt->config->id, flt->flags, flt->pre_analyzers, flt->post_analyzers);
+               }
 
                chunk_appendf(&trash,
                             "  res=%p (f=0x%06x an=0x%x pipe=%d tofwd=%d total=%lld)\n"
@@ -3420,6 +3426,12 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                                      (htx->tail >= htx->head) ? "NO" : "YES",
                                      (unsigned long long)htx->extra);
                }
+               if (HAS_FILTERS(strm) && strm_flt(strm)->current[1]) {
+                       struct filter *flt = strm_flt(strm)->current[1];
+
+                       chunk_appendf(&trash, "      current_filter=%p (id=\"%s\" flags=0x%x pre=0x%x post=0x%x) \n",
+                                     flt, flt->config->id, flt->flags, flt->pre_analyzers, flt->post_analyzers);
+               }
 
                if (strm->current_rule_list && strm->current_rule) {
                        const struct act_rule *rule = strm->current_rule;