int hexdump;
};
-#define TRACE(conf, fmt, ...) \
+#define FLT_TRACE(conf, fmt, ...) \
fprintf(stderr, "%d.%06d [%-20s] " fmt "\n", \
(int)now.tv_sec, (int)now.tv_usec, (conf)->name, \
##__VA_ARGS__)
-#define STRM_TRACE(conf, strm, fmt, ...) \
+#define FLT_STRM_TRACE(conf, strm, fmt, ...) \
fprintf(stderr, "%d.%06d [%-20s] [strm %p(%x) 0x%08x 0x%08x] " fmt "\n", \
(int)now.tv_sec, (int)now.tv_usec, (conf)->name, \
strm, (strm ? ((struct stream *)strm)->uniq_id : ~0U), \
fconf->flags |= FLT_CFG_FL_HTX;
fconf->conf = conf;
- TRACE(conf, "filter initialized [read random=%s - fwd random=%s - hexdump=%s]",
+ FLT_TRACE(conf, "filter initialized [read random=%s - fwd random=%s - hexdump=%s]",
(conf->rand_parsing ? "true" : "false"),
(conf->rand_forwarding ? "true" : "false"),
(conf->hexdump ? "true" : "false"));
struct trace_config *conf = fconf->conf;
if (conf) {
- TRACE(conf, "filter deinitialized");
+ FLT_TRACE(conf, "filter deinitialized");
free(conf->name);
free(conf);
}
{
struct trace_config *conf = fconf->conf;
- TRACE(conf, "filter initialized for thread tid %u", tid);
+ FLT_TRACE(conf, "filter initialized for thread tid %u", tid);
return 0;
}
struct trace_config *conf = fconf->conf;
if (conf)
- TRACE(conf, "filter deinitialized for thread tid %u", tid);
+ FLT_TRACE(conf, "filter deinitialized for thread tid %u", tid);
}
/**************************************************************************
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: filter-type=%s",
+ FLT_STRM_TRACE(conf, s, "%-25s: filter-type=%s",
__FUNCTION__, filter_type(filter));
return 1;
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: filter-type=%s",
+ FLT_STRM_TRACE(conf, s, "%-25s: filter-type=%s",
__FUNCTION__, filter_type(filter));
}
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s",
+ FLT_STRM_TRACE(conf, s, "%-25s",
__FUNCTION__);
return 0;
}
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: backend=%s",
+ FLT_STRM_TRACE(conf, s, "%-25s: backend=%s",
__FUNCTION__, be->id);
return 0;
}
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s",
+ FLT_STRM_TRACE(conf, s, "%-25s",
__FUNCTION__);
}
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s",
+ FLT_STRM_TRACE(conf, s, "%-25s",
__FUNCTION__);
}
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
__FUNCTION__,
channel_label(chn), proxy_mode(s), stream_pos(s));
filter->pre_analyzers |= (AN_REQ_ALL | AN_RES_ALL);
ana = "unknown";
}
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - "
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - "
"analyzer=%s - step=%s",
__FUNCTION__,
channel_label(chn), proxy_mode(s), stream_pos(s),
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
__FUNCTION__,
channel_label(chn), proxy_mode(s), stream_pos(s));
return 1;
struct htx_sl *sl = http_get_stline(htx);
int32_t pos;
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)\t%.*s %.*s %.*s",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)\t%.*s %.*s %.*s",
__FUNCTION__,
channel_label(msg->chn), proxy_mode(s), stream_pos(s),
HTX_SL_P1_LEN(sl), HTX_SL_P1_PTR(sl),
n = htx_get_blk_name(htx, blk);
v = htx_get_blk_value(htx, blk);
- STRM_TRACE(conf, s, "\t%.*s: %.*s",
+ FLT_STRM_TRACE(conf, s, "\t%.*s: %.*s",
(int)n.len, n.ptr, (int)v.len, v.ptr);
}
return 1;
}
}
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - "
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - "
"offset=%u - len=%u - forward=%d",
__FUNCTION__,
channel_label(msg->chn), proxy_mode(s), stream_pos(s),
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
__FUNCTION__,
channel_label(msg->chn), proxy_mode(s), stream_pos(s));
return 1;
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
__FUNCTION__,
channel_label(msg->chn), proxy_mode(s), stream_pos(s));
}
{
struct trace_config *conf = FLT_CONF(filter);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s)",
__FUNCTION__, "-", proxy_mode(s), stream_pos(s));
}
if (ret && conf->rand_parsing)
ret = random() % (ret+1);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - next=%u - avail=%u - consume=%d",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - next=%u - avail=%u - consume=%d",
__FUNCTION__,
channel_label(chn), proxy_mode(s), stream_pos(s),
FLT_NXT(filter, chn), avail, ret);
if (ret && conf->rand_forwarding)
ret = random() % (ret+1);
- STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - len=%u - fwd=%u - forward=%d",
+ FLT_STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - len=%u - fwd=%u - forward=%d",
__FUNCTION__,
channel_label(chn), proxy_mode(s), stream_pos(s), len,
FLT_FWD(filter, chn), ret);