]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Save port number in upstream name
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 13 Nov 2019 13:13:09 +0000 (13:13 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 13 Nov 2019 13:13:09 +0000 (13:13 +0000)
src/libutil/addr.c

index 15480a9ad121d014e68e11bb48f49a9d7c4085f2..03e7e9918f4208749a13d9294d7b000ee5be37a1 100644 (file)
@@ -1440,8 +1440,18 @@ rspamd_parse_host_port_priority (const gchar *str,
                                        portbuf, 0, pool);
                }
                else {
+                       const gchar *second_semicolon = strchr (p + 1, ':');
+
                        name = str;
-                       namelen = p - str;
+
+                       if (second_semicolon) {
+                               /* name + port part excluding priority */
+                               namelen = second_semicolon - str;
+                       }
+                       else {
+                               /* Full ip/name + port */
+                               namelen = strlen (str);
+                       }
 
                        if (!rspamd_check_port_priority (p, default_port, priority, portbuf,
                                        sizeof (portbuf), pool)) {