Browse Source

[Net] IP uses print_verbose when getaddrinfo fails.

Avoid spamming errors when network is disconnected.
Returned address will be invalid, so it can be checked by the user via
`ret.is_valid_ip_address`.

(cherry picked from commit 59eea34851ef3b71bd9df4258f589d2c9681f5a7)
Fabio Alessandrelli 3 years ago
parent
commit
90c6056b70
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/unix/ip_unix.cpp

+ 2 - 2
drivers/unix/ip_unix.cpp

@@ -95,12 +95,12 @@ void IP_Unix::_resolve_hostname(List<IP_Address> &r_addresses, const String &p_h
 
 
 	int s = getaddrinfo(p_hostname.utf8().get_data(), nullptr, &hints, &result);
 	int s = getaddrinfo(p_hostname.utf8().get_data(), nullptr, &hints, &result);
 	if (s != 0) {
 	if (s != 0) {
-		ERR_PRINT("getaddrinfo failed! Cannot resolve hostname.");
+		print_verbose("getaddrinfo failed! Cannot resolve hostname.");
 		return;
 		return;
 	};
 	};
 
 
 	if (result == nullptr || result->ai_addr == nullptr) {
 	if (result == nullptr || result->ai_addr == nullptr) {
-		ERR_PRINT("Invalid response from getaddrinfo");
+		print_verbose("Invalid response from getaddrinfo");
 		if (result) {
 		if (result) {
 			freeaddrinfo(result);
 			freeaddrinfo(result);
 		}
 		}