[fix] ipv6 address parsing

This commit is contained in:
Dmitry Orlov 2018-07-05 13:01:06 +03:00
parent 36152f570d
commit a2a5d78fbd

View File

@ -102,7 +102,7 @@ void Socket::getFirstAddr(const char* addr, int type, int protocol, sockaddr* re
} else {
std::string tmp;
const char* host = addr;
const char* port = strchr(addr, ':');
const char* port = strrchr(addr, ':');
if (port) {
tmp.append(addr, port - addr);
host = tmp.c_str();