mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
Merge a83b4d019d into 36152f570d
This commit is contained in:
commit
fc809da7e9
@ -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));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user