aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/protocol.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-05 12:56:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-05 13:05:45 +0100
commit34eea43c42c334b44a047fa58135530d8ee944d6 (patch)
tree021da2b916583e18dfda1bd74722991d49c8ec8d /src/libserver/protocol.c
parentf0a395c9c90f7672979f7963627cdd23b0e04e36 (diff)
downloadrspamd-34eea43c42c334b44a047fa58135530d8ee944d6.tar.gz
rspamd-34eea43c42c334b44a047fa58135530d8ee944d6.zip
[Fix] Fix printing from field in log_urls
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r--src/libserver/protocol.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index f508a2f3a..e10231b79 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -675,6 +675,7 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud)
struct rspamd_task *task = cb->task;
const gchar *user_field = "unknown";
gboolean has_user = FALSE;
+ guint len = 0;
if (!(task->flags & RSPAMD_TASK_FLAG_EXT_URLS)) {
obj = ucl_object_fromlstring (url->string, url->urllen);
@@ -688,16 +689,18 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud)
if (cb->task->cfg->log_urls) {
if (task->user) {
user_field = task->user;
+ len = strlen (task->user);
has_user = TRUE;
}
else if (task->from_envelope) {
user_field = task->from_envelope->addr;
+ len = task->from_envelope->addr_len;
}
- msg_info_task ("<%s> %s: %s; ip: %s; URL: %*s",
+ msg_info_task ("<%s> %s: %*s; ip: %s; URL: %*s",
task->message_id,
has_user ? "user" : "from",
- user_field,
+ len, user_field,
rspamd_inet_address_to_string (task->from_addr),
url->urllen, url->string);
}