diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-13 13:13:09 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-13 13:13:09 +0000 |
commit | 54e835fc3540cc4dae025976fd15a0ad9cf10833 (patch) | |
tree | a8b2dd518d6ea7659fa9c118edcd183aa2f2856c /src/libutil/addr.c | |
parent | e87526230e690ee824f554f99ef0253cfb5670af (diff) | |
download | rspamd-54e835fc3540cc4dae025976fd15a0ad9cf10833.tar.gz rspamd-54e835fc3540cc4dae025976fd15a0ad9cf10833.zip |
[Minor] Save port number in upstream name
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r-- | src/libutil/addr.c | 12 |
1 files changed, 11 insertions, 1 deletions
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)) { |