diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-25 21:27:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-25 21:27:57 +0000 |
commit | 01fda151e4995e8ed3e5c5ec31eb856a399ce14b (patch) | |
tree | da250f38fd4b0ab1f45fbbaad7bdb91a1f973a36 | |
parent | 14f2501b0c6500d1c3218d66db5a30b082be759b (diff) | |
download | rspamd-01fda151e4995e8ed3e5c5ec31eb856a399ce14b.tar.gz rspamd-01fda151e4995e8ed3e5c5ec31eb856a399ce14b.zip |
Fix urls output in the protocol
-rw-r--r-- | src/libserver/protocol.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index b140ca2c6..58850209e 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -627,27 +627,27 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud) gboolean has_user = FALSE; if (!(task->flags & RSPAMD_TASK_FLAG_EXT_URLS)) { - obj = ucl_object_fromlstring (url->host, url->hostlen); + obj = ucl_object_fromlstring (url->string, url->urllen); } else { obj = ucl_object_typed_new (UCL_OBJECT); - elt = ucl_object_fromstring (url->string); + elt = ucl_object_fromlstring (url->string, url->urllen); ucl_object_insert_key (obj, elt, "url", 0, false); - if (url->hostlen > 0) { - elt = ucl_object_fromlstring (url->host, url->hostlen); - ucl_object_insert_key (obj, elt, "host", 0, false); - } - if (url->surbllen > 0) { elt = ucl_object_fromlstring (url->surbl, url->surbllen); ucl_object_insert_key (obj, elt, "surbl", 0, false); } + if (url->hostlen > 0) { + elt = ucl_object_fromlstring (url->host, url->hostlen); + ucl_object_insert_key (obj, elt, "host", 0, false); + } elt = ucl_object_frombool (url->flags & RSPAMD_URL_FLAG_PHISHED); ucl_object_insert_key (obj, elt, "phished", 0, false); } + ucl_array_append (cb->top, obj); if (cb->task->cfg->log_urls) { |