From: Vsevolod Stakhov Date: Fri, 25 Dec 2015 21:27:57 +0000 (+0000) Subject: Fix urls output in the protocol X-Git-Tag: 1.1.0~204 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01fda151e4995e8ed3e5c5ec31eb856a399ce14b;p=thirdparty%2Frspamd.git Fix urls output in the protocol --- diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index b140ca2c6c..58850209e2 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) {