CLEANUP: stream: remove the now unused stream_dump() function

It was superseded by strm_dump_to_buffer() which provides much more
complete information and supports anonymizing.
This commit is contained in:
Willy Tarreau 2023-09-29 09:15:06 +02:00
parent feff6296a1
commit d956db6638
2 changed files with 0 additions and 71 deletions

View File

@ -66,7 +66,6 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot
/* kill a stream and set the termination flags to <why> (one of SF_ERR_*) */ /* kill a stream and set the termination flags to <why> (one of SF_ERR_*) */
void stream_shutdown(struct stream *stream, int why); 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 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); void strm_dump_to_buffer(struct buffer *buf, const struct stream *strm, const char *pfx, uint32_t anon_key);

View File

@ -2805,76 +2805,6 @@ void stream_shutdown(struct stream *stream, int why)
task_wakeup(stream->task, TASK_WOKEN_OTHER); task_wakeup(stream->task, TASK_WOKEN_OTHER);
} }
/* Appends a dump of the state of stream <s> into buffer <buf> which must have
* preliminary be prepared by its caller, with each line prepended by prefix
* <pfx>, and each line terminated by character <eol>.
*/
void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx)
{
const struct stconn *scf, *scb;
const struct connection *cof, *cob;
const struct appctx *acf, *acb;
const struct server *srv;
const char *src = "unknown";
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);
return;
}
if (s->obj_type != OBJ_TYPE_STREAM) {
chunk_appendf(buf, "%sstrm=%p [invalid type=%d(%s)]%c",
pfx, s, s->obj_type, obj_type_name(&s->obj_type), eol);
return;
}
req = &s->req;
res = &s->res;
scf = s->scf;
cof = (scf && scf->sedesc) ? sc_conn(scf) : NULL;
acf = (scf && scf->sedesc) ? sc_appctx(scf) : NULL;
if (cof && cof->src && addr_to_str(cof->src, pn, sizeof(pn)) >= 0)
src = pn;
else if (acf)
src = acf->applet->name;
scb = s->scb;
cob = (scb && scb->sedesc) ? sc_conn(scb) : NULL;
acb = (scb && scb->sedesc) ? sc_appctx(scb) : NULL;
srv = objt_server(s->target);
if (srv)
dst = srv->id;
else if (acb)
dst = acb->applet->name;
chunk_appendf(buf,
"%sstrm=%p,%x src=%s fe=%s be=%s dst=%s%c"
"%stxn=%p,%x txn.req=%s,%x txn.rsp=%s,%x%c"
"%srqf=%x rqa=%x rpf=%x rpa=%x%c"
"%sscf=%p,%s,%x scb=%p,%s,%x%c"
"%saf=%p,%u sab=%p,%u%c"
"%scof=%p,%x:%s(%p)/%s(%p)/%s(%d)%c"
"%scob=%p,%x:%s(%p)/%s(%p)/%s(%d)%c"
"",
pfx, s, s->flags, src, s->sess->fe->id, s->be->id, dst, eol,
pfx, s->txn, (s->txn ? s->txn->flags : 0),
(s->txn ? h1_msg_state_str(s->txn->req.msg_state): "-"), (s->txn ? s->txn->req.flags : 0),
(s->txn ? h1_msg_state_str(s->txn->rsp.msg_state): "-"), (s->txn ? s->txn->rsp.flags : 0), eol,
pfx, req->flags, req->analysers, res->flags, res->analysers, eol,
pfx, scf, scf ? sc_state_str(scf->state) : 0, scf ? scf->flags : 0,
scb, scb ? sc_state_str(scb->state) : 0, scb ? scb->flags : 0, eol,
pfx, acf, acf ? acf->st0 : 0, acb, acb ? acb->st0 : 0, eol,
pfx, cof, cof ? cof->flags : 0, conn_get_mux_name(cof), cof?cof->ctx:0, conn_get_xprt_name(cof),
cof ? cof->xprt_ctx : 0, conn_get_ctrl_name(cof), conn_fd(cof), eol,
pfx, cob, cob ? cob->flags : 0, conn_get_mux_name(cob), cob?cob->ctx:0, conn_get_xprt_name(cob),
cob ? cob->xprt_ctx : 0, conn_get_ctrl_name(cob), conn_fd(cob), eol);
}
/* dumps an error message for type <type> at ptr <ptr> related to stream <s>, /* dumps an error message for type <type> at ptr <ptr> related to stream <s>,
* having reached loop rate <rate>, then aborts hoping to retrieve a core. * having reached loop rate <rate>, then aborts hoping to retrieve a core.
*/ */