You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[Net] Simplify IP resolution code, fix caching.
First, we should not insert into cache if the hostname resolution has
failed (as it might be a temporary internet issue), second, the async
resolver should also properly insert into cache.
Took the chance to remove some duplicate code with critical section in
it at the cost of little performance when calling the blocking
resolve_hostname function.
(cherry picked from commit 49297d937c)
This commit is contained in:
committed by
Rémi Verschelde
parent
c25365d5ff
commit
aa3ef20fcb
@@ -115,7 +115,7 @@ void IP_Unix::_resolve_hostname(List<IP_Address> &r_addresses, const String &p_h
|
||||
continue;
|
||||
}
|
||||
IP_Address ip = _sockaddr2ip(next->ai_addr);
|
||||
if (!r_addresses.find(ip)) {
|
||||
if (ip.is_valid() && !r_addresses.find(ip)) {
|
||||
r_addresses.push_back(ip);
|
||||
}
|
||||
next = next->ai_next;
|
||||
|
||||
Reference in New Issue
Block a user