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 {
|
} else {
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
const char* host = addr;
|
const char* host = addr;
|
||||||
const char* port = strchr(addr, ':');
|
const char* port = strrchr(addr, ':');
|
||||||
if (port) {
|
if (port) {
|
||||||
tmp.append(addr, port - addr);
|
tmp.append(addr, port - addr);
|
||||||
host = tmp.c_str();
|
host = tmp.c_str();
|
||||||
port++;
|
port++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logDebug("Connecting to %s", addr);
|
||||||
|
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
struct addrinfo *dst;
|
struct addrinfo *dst;
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user