diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h index 55a77bd39d..8bb4e5cf86 100644 --- a/include/haproxy/stream.h +++ b/include/haproxy/stream.h @@ -68,6 +68,7 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot void stream_shutdown(struct stream *stream, int why); void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx); void stream_dump_and_crash(enum obj_type *obj, int rate); +void strm_dump_to_buffer(struct buffer *buf, const struct stream *strm, const char *pfx, uint32_t anon_key); struct ist stream_generate_unique_id(struct stream *strm, struct list *format); diff --git a/src/stream.c b/src/stream.c index dedb2286d8..db633014a9 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2880,7 +2880,7 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx) */ void stream_dump_and_crash(enum obj_type *obj, int rate) { - const struct stream *s; + struct stream *s; char *msg = NULL; const void *ptr; @@ -2896,19 +2896,8 @@ void stream_dump_and_crash(enum obj_type *obj, int rate) } chunk_reset(&trash); - stream_dump(&trash, s, " "); - - chunk_appendf(&trash, " filters={"); - if (HAS_FILTERS(s)) { - struct filter *filter; - - list_for_each_entry(filter, &s->strm_flt.filters, list) { - if (filter->list.p != &s->strm_flt.filters) - chunk_appendf(&trash, ", "); - chunk_appendf(&trash, "%p=\"%s\"", filter, FLT_ID(filter)); - } - } - chunk_appendf(&trash, "}"); + chunk_printf(&trash, " "); + strm_dump_to_buffer(&trash, s, " ", HA_ATOMIC_LOAD(&global.anon_key)); if (ptr != s) { // that's an appctx const struct appctx *appctx = ptr; @@ -3245,7 +3234,7 @@ struct show_sess_ctx { * stream at once. Each new output line will be prefixed with if non-null, * which is used to preserve indenting. */ -static void strm_dump_to_buffer(struct buffer *buf, const struct stream *strm, const char *pfx, uint32_t anon_key) +void strm_dump_to_buffer(struct buffer *buf, const struct stream *strm, const char *pfx, uint32_t anon_key) { struct stconn *scf, *scb; struct tm tm;