diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-08-28 12:32:04 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-08-28 12:32:04 +0200 |
commit | 97757cd1d1b6b3702a47c6f28c200010cee335e4 (patch) | |
tree | 72538967afbe90c5f898ef47b9c1c5144458d692 /core/io/ip.cpp | |
parent | 6671096dd7a442b250a8d07a175db99ba02e6d5a (diff) | |
download | redot-engine-97757cd1d1b6b3702a47c6f28c200010cee335e4.tar.gz |
Fix DNS resolution when cache is invalid.
Fix StreamPeerTCP.connect_to_host return value.
Diffstat (limited to 'core/io/ip.cpp')
-rw-r--r-- | core/io/ip.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 66bd96df4f..82c94ca0b2 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -117,7 +117,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 +144,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 { |