mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MINOR: mux-spop/mux-fcgi: Add support of the debug string for logs
Now it is possible to have debug info about FCGI and SPOP multiplexers. To do so, the support for the MUX_SCTL_DBG_STR command was implemented for these muxes. The have this log message, the log-format must be set to: log-format "$HAPROXY_HTTP_LOG_FMT bs=<%[bs.debug_str]>"
This commit is contained in:
parent
456cfa450a
commit
0aa69e7865
@ -299,6 +299,8 @@ static void fcgi_strm_notify_recv(struct fcgi_strm *fstrm);
|
||||
static void fcgi_strm_notify_send(struct fcgi_strm *fstrm);
|
||||
static void fcgi_strm_alert(struct fcgi_strm *fstrm);
|
||||
static int fcgi_strm_send_abort(struct fcgi_conn *fconn, struct fcgi_strm *fstrm);
|
||||
static int fcgi_dump_fcgi_conn_info(struct buffer *msg, struct fcgi_conn *fconn, const char *pfx);
|
||||
static int fcgi_dump_fcgi_strm_info(struct buffer *msg, const struct fcgi_strm *fstrm, const char *pfx);
|
||||
|
||||
/* a dummy closed endpoint */
|
||||
static const struct sedesc closed_ep = {
|
||||
@ -3233,12 +3235,32 @@ static int fcgi_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *outpu
|
||||
{
|
||||
int ret = 0;
|
||||
struct fcgi_strm *fstrm = __sc_mux_strm(sc);
|
||||
union mux_sctl_dbg_str_ctx *dbg_ctx;
|
||||
struct buffer *buf;
|
||||
|
||||
switch (mux_sctl) {
|
||||
case MUX_SCTL_SID:
|
||||
if (output)
|
||||
*((int64_t *)output) = fstrm->id;
|
||||
return ret;
|
||||
case MUX_SCTL_DBG_STR:
|
||||
dbg_ctx = output;
|
||||
buf = get_trash_chunk();
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_MUXS)
|
||||
fcgi_dump_fcgi_strm_info(buf, fstrm, NULL);
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_MUXC)
|
||||
fcgi_dump_fcgi_conn_info(buf, fstrm->fconn, NULL);
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_CONN)
|
||||
chunk_appendf(buf, " conn.flg=%#08x conn.err_code=%u conn.evts=%s",
|
||||
fstrm->fconn->conn->flags, fstrm->fconn->conn->err_code,
|
||||
tevt_evts2str(fstrm->fconn->conn->term_evts_log));
|
||||
|
||||
/* other layers not implemented */
|
||||
dbg_ctx->ret.buf = *buf;
|
||||
return ret;
|
||||
case MUX_SCTL_TEVTS:
|
||||
return fstrm->sd->term_evts_log;
|
||||
default:
|
||||
|
@ -266,6 +266,8 @@ static void spop_strm_notify_send(struct spop_strm *spop_strm);
|
||||
static void spop_strm_alert(struct spop_strm *spop_strm);
|
||||
static inline void spop_remove_from_list(struct spop_strm *spop_strm);
|
||||
static inline void spop_conn_restart_reading(const struct spop_conn *spop_conn, int consider_buffer);
|
||||
static int spop_dump_spop_conn_info(struct buffer *msg, struct spop_conn *spop_conn, const char *pfx);
|
||||
static int spop_dump_spop_strm_info(struct buffer *msg, const struct spop_strm *spop_strm, const char *pfx);
|
||||
|
||||
/* a dummy closed endpoint */
|
||||
static const struct sedesc closed_ep = {
|
||||
@ -2671,12 +2673,32 @@ static int spop_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *outpu
|
||||
{
|
||||
int ret = 0;
|
||||
struct spop_strm *spop_strm = __sc_mux_strm(sc);
|
||||
union mux_sctl_dbg_str_ctx *dbg_ctx;
|
||||
struct buffer *buf;
|
||||
|
||||
switch (mux_sctl) {
|
||||
case MUX_SCTL_SID:
|
||||
if (output)
|
||||
*((int64_t *)output) = spop_strm->id;
|
||||
return ret;
|
||||
case MUX_SCTL_DBG_STR:
|
||||
dbg_ctx = output;
|
||||
buf = get_trash_chunk();
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_MUXS)
|
||||
spop_dump_spop_strm_info(buf, spop_strm, NULL);
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_MUXC)
|
||||
spop_dump_spop_conn_info(buf, spop_strm->spop_conn, NULL);
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_CONN)
|
||||
chunk_appendf(buf, " conn.flg=%#08x conn.err_code=%u conn.evts=%s",
|
||||
spop_strm->spop_conn->conn->flags, spop_strm->spop_conn->conn->err_code,
|
||||
tevt_evts2str(spop_strm->spop_conn->conn->term_evts_log));
|
||||
|
||||
/* other layers not implemented */
|
||||
dbg_ctx->ret.buf = *buf;
|
||||
return ret;
|
||||
case MUX_SCTL_TEVTS:
|
||||
return spop_strm->sd->term_evts_log;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user