mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-06 11:22:55 +08:00
Problem: tcp_address.cpp allowed [ and ] around address
This syntax is undocumented and has no known meaning. It was in libzmq since 3.x. Solution: remove this code.
This commit is contained in:
parent
deaad00ad9
commit
78a7b469a1
@ -413,11 +413,6 @@ int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv6_, boo
|
||||
std::string addr_str (name_, delimiter - name_);
|
||||
std::string port_str (delimiter + 1);
|
||||
|
||||
// Remove square brackets around the address, if any.
|
||||
if (addr_str.size () >= 2 && addr_str [0] == '[' &&
|
||||
addr_str [addr_str.size () - 1] == ']')
|
||||
addr_str = addr_str.substr (1, addr_str.size () - 2);
|
||||
|
||||
// Allow 0 specifically, to detect invalid port error in atoi if not
|
||||
uint16_t port;
|
||||
if (port_str == "*" || port_str == "0")
|
||||
|
Loading…
x
Reference in New Issue
Block a user