Fix IPAddress::init_host_port on Windows.
GitOrigin-RevId: 3ecc70e2af540a1a00a4f5cc6689920e557d5260
This commit is contained in:
parent
134849c906
commit
6c5fb4e6f6
@ -143,6 +143,14 @@ Status IPAddress::init_host_port(CSlice host, int port) {
|
||||
}
|
||||
|
||||
Status IPAddress::init_host_port(CSlice host, CSlice port) {
|
||||
if (host.empty()) {
|
||||
return Status::Error("Host is empty");
|
||||
}
|
||||
#if TD_WINDOWS
|
||||
if (host == "..localmachine") {
|
||||
return Status::Error("Host is invalid");
|
||||
}
|
||||
#endif
|
||||
addrinfo hints;
|
||||
addrinfo *info = nullptr;
|
||||
std::memset(&hints, 0, sizeof(hints));
|
||||
|
Loading…
Reference in New Issue
Block a user