]> source.dussan.org Git - rspamd.git/commitdiff
Some more fixes to the test.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 2 Nov 2014 19:03:15 +0000 (19:03 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 2 Nov 2014 19:03:15 +0000 (19:03 +0000)
src/libutil/upstream.c
test/rspamd_upstream_test.c

index b18e2585fbcdacb3ec0254b785e0fcbf4adf79da..2ff8f2651cbedc8ece2d98a2160a9cf3deaaab91 100644 (file)
@@ -367,6 +367,9 @@ rspamd_upstreams_parse_line (struct upstream_list *ups,
                        if (rspamd_upstreams_add_upstream (ups, tmp, def_port, data)) {
                                ret = TRUE;
                        }
+                       else {
+                               g_free (tmp);
+                       }
                }
                p += len;
                /* Skip separators */
index 531f0bd279597e28017b81852ffff7c05853f2fd..5c25f120d5e2d9f1cfa03300b32baa812444a9be 100644 (file)
@@ -27,7 +27,7 @@
 #include "main.h"
 #include "upstream.h"
 
-const char *test_upstream_list = "microsoft.com:443:1,google.com:2,kernel.org:443:3";
+const char *test_upstream_list = "microsoft.com:443:1,google.com:80:2,kernel.org:443:3";
 
 
 static void
@@ -69,5 +69,8 @@ rspamd_upstream_test_func (void)
        /* Test round-robin rotation */
        rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "kernel.org");
        rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "google.com");
+       rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "kernel.org");
        rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "microsoft.com");
+       rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "google.com");
+       rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "kernel.org");
 }