mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
[fix] ipv6 address parsing
This commit is contained in:
parent
36152f570d
commit
a2a5d78fbd
@ -102,7 +102,7 @@ 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();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user