diff options
Diffstat (limited to 'core/io/ip.cpp')
-rw-r--r-- | core/io/ip.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 66bd96df4f..f56e850796 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -29,9 +29,10 @@ /*************************************************************************/ #include "ip.h" -#include "hash_map.h" -#include "os/semaphore.h" -#include "os/thread.h" + +#include "core/hash_map.h" +#include "core/os/semaphore.h" +#include "core/os/thread.h" VARIANT_ENUM_CAST(IP::ResolverStatus); @@ -117,7 +118,7 @@ IP_Address IP::resolve_hostname(const String &p_hostname, IP::Type p_type) { resolver->mutex->lock(); String key = _IP_ResolverPrivate::get_cache_key(p_hostname, p_type); - if (resolver->cache.has(key)) { + if (resolver->cache.has(key) && resolver->cache[key].is_valid()) { IP_Address res = resolver->cache[key]; resolver->mutex->unlock(); return res; @@ -144,7 +145,7 @@ IP::ResolverID IP::resolve_hostname_queue_item(const String &p_hostname, IP::Typ String key = _IP_ResolverPrivate::get_cache_key(p_hostname, p_type); resolver->queue[id].hostname = p_hostname; resolver->queue[id].type = p_type; - if (resolver->cache.has(key)) { + if (resolver->cache.has(key) && resolver->cache[key].is_valid()) { resolver->queue[id].response = resolver->cache[key]; resolver->queue[id].status = IP::RESOLVER_STATUS_DONE; } else { |