commit 54e835f: [Minor] Save port number in upstream name
Vsevolod Stakhov
vsevolod at highsecure.ru
Wed Nov 13 13:14:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-11-13 13:13:09 +0000
URL: https://github.com/rspamd/rspamd/commit/54e835fc3540cc4dae025976fd15a0ad9cf10833 (HEAD -> master)
[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)) {
More information about the Commits
mailing list