aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-28 17:52:16 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-28 17:52:16 +0300
commitafd505282b65a900b99113138e63fad6193ed3c9 (patch)
tree5bc53e15e4d9a84dbc6725de9539168faa67f36f /src
parent287067006bf2b44b9a68f3dd9d24414f4902e225 (diff)
downloadrspamd-afd505282b65a900b99113138e63fad6193ed3c9.tar.gz
rspamd-afd505282b65a900b99113138e63fad6193ed3c9.zip
Fix log_urls setting.
Diffstat (limited to 'src')
-rw-r--r--src/kvstorage_server.c2
-rw-r--r--src/protocol.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/kvstorage_server.c b/src/kvstorage_server.c
index 0eba6fcff..683c5a2e4 100644
--- a/src/kvstorage_server.c
+++ b/src/kvstorage_server.c
@@ -966,7 +966,7 @@ thr_accept_socket (gint fd, short what, void *arg)
return;
}
- session = g_slice_alloc (sizeof (struct kvstorage_session));
+ session = g_slice_alloc0 (sizeof (struct kvstorage_session));
session->pool = memory_pool_new (memory_pool_get_size ());
session->state = KVSTORAGE_STATE_READ_CMD;
session->thr = thr;
diff --git a/src/protocol.c b/src/protocol.c
index 73f8b9de6..70ba1bd83 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -651,6 +651,7 @@ struct tree_cb_data {
gchar *buf;
gsize len;
gsize off;
+ struct worker_task *task;
};
/*
@@ -672,6 +673,12 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud)
cb->off += rspamd_snprintf (cb->buf + cb->off, cb->len - cb->off, " %*s,",
url->hostlen, url->host);
}
+
+ if (cb->task->cfg->log_urls) {
+ msg_info ("<%s> URL: %s - %s: %s", cb->task->message_id, cb->task->user ?
+ cb->task->user : "unknown", inet_ntoa (cb->task->client_addr), struri (url));
+ }
+
return FALSE;
}
@@ -687,6 +694,7 @@ show_url_header (struct worker_task *task)
cb.buf = outbuf;
cb.len = sizeof (outbuf);
cb.off = r;
+ cb.task = task;
g_tree_foreach (task->urls, urls_protocol_cb, &cb);
/* Strip last ',' */
@@ -736,6 +744,7 @@ show_email_header (struct worker_task *task)
cb.buf = outbuf;
cb.len = sizeof (outbuf);
cb.off = r;
+ cb.task = task;
g_tree_foreach (task->emails, emails_protocol_cb, &cb);
/* Strip last ',' */