diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h index 19ef92c35..55a77bd39 100644 --- a/include/haproxy/stream.h +++ b/include/haproxy/stream.h @@ -66,7 +66,7 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot /* kill a stream and set the termination flags to (one of SF_ERR_*) */ void stream_shutdown(struct stream *stream, int why); -void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, char eol); +void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx); void stream_dump_and_crash(enum obj_type *obj, int rate); struct ist stream_generate_unique_id(struct stream *strm, struct list *format); diff --git a/src/debug.c b/src/debug.c index 89c7a53de..24e916744 100644 --- a/src/debug.c +++ b/src/debug.c @@ -325,7 +325,7 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx) s = sc_strm(((struct stconn *)task->context)); if (s) - stream_dump(buf, s, pfx, '\n'); + stream_dump(buf, s, pfx); #ifdef USE_LUA hlua = NULL; diff --git a/src/stream.c b/src/stream.c index 35759037c..d95b92041 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2809,7 +2809,7 @@ void stream_shutdown(struct stream *stream, int why) * preliminary be prepared by its caller, with each line prepended by prefix * , and each line terminated by character . */ -void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, char eol) +void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx) { const struct stconn *scf, *scb; const struct connection *cof, *cob; @@ -2819,6 +2819,7 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, ch const char *dst = "unknown"; char pn[INET6_ADDRSTRLEN]; const struct channel *req, *res; + char eol = '\n'; if (!s) { chunk_appendf(buf, "%sstrm=%p%c", pfx, s, eol); @@ -2895,9 +2896,9 @@ void stream_dump_and_crash(enum obj_type *obj, int rate) } chunk_reset(&trash); - stream_dump(&trash, s, "", ' '); + stream_dump(&trash, s, " "); - chunk_appendf(&trash, "filters={"); + chunk_appendf(&trash, " filters={"); if (HAS_FILTERS(s)) { struct filter *filter; @@ -2923,8 +2924,8 @@ void stream_dump_and_crash(enum obj_type *obj, int rate) memprintf(&msg, "A bogus %s [%p] is spinning at %d calls per second and refuses to die, " - "aborting now! Please report this error to developers " - "[%s]\n", + "aborting now! Please report this error to developers:\n" + "%s\n", obj_type_name(obj), ptr, rate, trash.area); ha_alert("%s", msg);