diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-11-06 20:47:07 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-11-06 20:47:07 +0300 |
commit | bfda3c0113c0c2eb4284ad428a84c7db2fa4b9e3 (patch) | |
tree | 511c8dbd4d82e5d8900f8b3784936f617a82dfc9 /src/protocol.c | |
parent | 61d89e0791f1d1a2d590ee7c05e6ad5066d1ee3d (diff) | |
download | rspamd-bfda3c0113c0c2eb4284ad428a84c7db2fa4b9e3.tar.gz rspamd-bfda3c0113c0c2eb4284ad428a84c7db2fa4b9e3.zip |
* Add logging urls as it was required by rambler search
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/protocol.c b/src/protocol.c index 3758de8a2..b89d5767a 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -87,6 +87,9 @@ static GList *custom_commands = NULL; +/* For default metric, dirty hack, but much faster than hash lookup */ +static double default_score, default_required_score; + static char * separate_command (f_str_t * in, char c) { @@ -414,6 +417,10 @@ show_url_header (struct worker_task *task) cur = task->urls; while (cur) { url = cur->data; + if (task->cfg->log_urls) { + /* Write this url to log as well */ + msg_info ("process_message: url found: <%s>, score: [%.2f / %.2f]", struri (url), default_score, default_required_score); + } host.begin = url->host; host.len = url->hostlen; /* Skip long hosts to avoid protocol coollisions */ @@ -530,7 +537,9 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data if (metric_name == NULL || metric_value == NULL) { - m = g_hash_table_lookup (task->cfg->metrics, "default"); + m = g_hash_table_lookup (task->cfg->metrics, DEFAULT_METRIC); + default_required_score = m->required_score; + default_score = 0; if (!check_metric_settings (task, m, &ms, &rs)) { ms = m->required_score; rs = m->reject_score; @@ -559,6 +568,12 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data } } else { + /* XXX: dirty hack */ + if (strcmp (metric_res->metric->name, DEFAULT_METRIC) == 0) { + default_required_score = metric_res->metric->required_score; + default_score = metric_res->score; + } + if (!check_metric_settings (task, metric_res->metric, &ms, &rs)) { ms = metric_res->metric->required_score; rs = metric_res->metric->reject_score; |