From 54e835fc3540cc4dae025976fd15a0ad9cf10833 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 13 Nov 2019 13:13:09 +0000 Subject: [PATCH] [Minor] Save port number in upstream name --- src/libutil/addr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 15480a9ad..03e7e9918 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -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)) { -- 2.39.5