diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-15 19:51:31 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-15 19:51:31 +0400 |
commit | b8a6d1944389ddad256dfe5a74929f2af1cf52cf (patch) | |
tree | 56007bfb1b636e7a257e24b47973ffc3570ea089 /src/protocol.c | |
parent | c76bd2e9ab2506ef06cc291c3e4b6b57ae08ea65 (diff) | |
download | rspamd-b8a6d1944389ddad256dfe5a74929f2af1cf52cf.tar.gz rspamd-b8a6d1944389ddad256dfe5a74929f2af1cf52cf.zip |
* Fix 'urls' command
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/protocol.c b/src/protocol.c index 7f6c98295..ebfaa4df7 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -619,33 +619,14 @@ static int write_urls_reply (struct worker_task *task) { int r; - char outbuf[OUTBUFSIZ], logbuf[OUTBUFSIZ]; - struct metric_result *metric_res; - struct metric_callback_data cd; + char outbuf[OUTBUFSIZ]; r = snprintf (outbuf, sizeof (outbuf), "%s 0 %s" CRLF, (task->proto == SPAMC_PROTO) ? SPAMD_REPLY_BANNER : RSPAMD_REPLY_BANNER, "OK"); rspamd_dispatcher_write (task->dispatcher, outbuf, r, TRUE); - cd.task = task; - cd.log_buf = logbuf; - cd.log_offset = snprintf (logbuf, sizeof (logbuf), "process_message: msg ok, id: <%s>, ", task->message_id); - cd.log_size = sizeof (logbuf); + show_url_header (task); - /* Ignore metrics, just write report for 'default' metric */ - metric_res = g_hash_table_lookup (task->results, "default"); - if (metric_res == NULL) { - /* Implicit metric result */ - show_metric_result (NULL, NULL, (void *)&cd); - } - else { - g_hash_table_foreach (metric_res->symbols, metric_symbols_callback, &cd); - /* Remove last , from log buf */ - if (cd.log_buf[cd.log_offset - 1] == ',') { - cd.log_buf[--cd.log_offset] = '\0'; - } - } - msg_info ("%s", logbuf); - rspamd_dispatcher_write (task->dispatcher, CRLF, sizeof (CRLF) - 1, FALSE); + msg_info ("process_message: msg ok, id: <%s>, %d urls extracted", task->message_id, g_list_length (task->urls)); return 0; } |