Browse Source

Prevent HTTPRequest from polling invalid client

Micky 3 years ago
parent
commit
9e284f68ec
1 changed files with 4 additions and 0 deletions
  1. 4 0
      core/io/http_client_tcp.cpp

+ 4 - 0
core/io/http_client_tcp.cpp

@@ -94,6 +94,10 @@ Error HTTPClientTCP::connect_to_host(const String &p_host, int p_port, bool p_ss
 	} else {
 	} else {
 		// Host contains hostname and needs to be resolved to IP.
 		// Host contains hostname and needs to be resolved to IP.
 		resolving = IP::get_singleton()->resolve_hostname_queue_item(server_host);
 		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;
 		status = STATUS_RESOLVING;
 	}
 	}