From 01fda151e4995e8ed3e5c5ec31eb856a399ce14b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 25 Dec 2015 21:27:57 +0000 Subject: Fix urls output in the protocol --- src/libserver/protocol.c | 14 +++++++------- 1 file 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) { -- cgit v1.2.3