This commit is contained in:
Mosquito 2018-07-05 10:35:14 +00:00 committed by GitHub
commit fc809da7e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,12 +102,15 @@ 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();
port++;
}
logDebug("Connecting to %s", addr);
struct addrinfo hints;
struct addrinfo *dst;
memset(&hints, 0, sizeof(hints));