Browse Source

Prevent HTTPRequest from polling invalid client

(cherry picked from commit 9e284f68ec79be745c2cb3d3a4eead3dfcca7cca)
Micky 3 năm trước cách đây
mục cha
commit
93943bc1b9
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      core/io/http_client.cpp

+ 4 - 0
core/io/http_client.cpp

@@ -101,6 +101,10 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl,
 	} else {
 		// Host contains hostname and needs to be resolved to IP
 		resolving = IP::get_singleton()->resolve_hostname_queue_item(server_host);
+		if (resolving == IP::RESOLVER_INVALID_ID) {
+			status = STATUS_CANT_RESOLVE;
+			return ERR_CANT_RESOLVE;
+		}
 		status = STATUS_RESOLVING;
 	}