]> source.dussan.org Git - rspamd.git/commitdiff
Fix urls output in the protocol
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Dec 2015 21:27:57 +0000 (21:27 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Dec 2015 21:27:57 +0000 (21:27 +0000)
src/libserver/protocol.c

index b140ca2c6cbc7dbbb608102eadc122a74cb6f7e2..58850209e2f445c4630b6193ed7cda557516acf0 100644 (file)
@@ -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) {