From 5c785fd1d0fb78a1bd3b8ed30713a5dc52655d1a Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Wed, 10 Feb 2021 10:29:48 +1000 Subject: [PATCH] * update filter stats format & fix inline config --- src/filter.c | 2 +- src/filters/filter.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/filter.c b/src/filter.c index 9b79e84..2023326 100644 --- a/src/filter.c +++ b/src/filter.c @@ -60,7 +60,7 @@ f2b_filter_load_file(f2b_filter_t *filter, const char *path) { if ((p = strstr(p, "set: ")) != NULL) { /* inline config line */ if ((param = f2b_config_param_create(p + 5)) != NULL) { - filter->config(filter->h, param->name, param->value); + filter->config(filter->cfg, param->name, param->value); free(param); } } /* else: just comment line */ diff --git a/src/filters/filter.c b/src/filters/filter.c index 1770f43..d3b103b 100644 --- a/src/filters/filter.c +++ b/src/filters/filter.c @@ -40,8 +40,7 @@ stats(cfg_t *cfg, char *buf, size_t bufsize) { char tmp[PATTERN_MAX + 64]; const char *fmt = "- pattern: %s\n" - " matches: %d\n" - " tag: %08x\n"; + " info: tag=%08X score=%d matches=%d\n"; assert(cfg != NULL); @@ -49,7 +48,7 @@ stats(cfg_t *cfg, char *buf, size_t bufsize) { return false; for (rx_t *rx = cfg->regexps; rx != NULL; rx = rx->next) { - snprintf(tmp, sizeof(tmp), fmt, rx->pattern, rx->matches, rx->ftag); + snprintf(tmp, sizeof(tmp), fmt, rx->pattern, rx->ftag, rx->score, rx->matches); strlcat(buf, tmp, bufsize); }