mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Only test TCP ports if the hostname resolves to multiple addresses
This commit is contained in:
parent
93ce13e43f
commit
ea135be05a
@ -301,8 +301,9 @@ int resolveHostName(const char* host, int family, int tcpTestPort, struct sockad
|
||||
}
|
||||
|
||||
for (currentAddr = res; currentAddr != NULL; currentAddr = currentAddr->ai_next) {
|
||||
// Use the test port to ensure this address is working
|
||||
if (tcpTestPort != 0) {
|
||||
// Use the test port to ensure this address is working if there
|
||||
// are multiple addresses for this host name
|
||||
if (tcpTestPort != 0 && res->ai_next != NULL) {
|
||||
SOCKET testSocket = connectTcpSocket((struct sockaddr_storage*)currentAddr->ai_addr,
|
||||
currentAddr->ai_addrlen,
|
||||
tcpTestPort,
|
||||
|
Loading…
x
Reference in New Issue
Block a user