mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-10-27 06:21:26 +00:00
[DNS] Fix hostByName returning negative values when lookup failed
`hostByName` does only return `1` on success, however it may return a negative value when lookup failed. So need to check for the exact return value and not consider it a boolean return type.
This commit is contained in:
1 parent
488cb70ba9
commit
050017b2b0
3 files changed
+3
-3
No files matched your search
@@ -1173,7 +1173,7 @@ bool HTTPClientLight::connect(void)
|
||||
} else {
|
||||
IPAddress remote_addr;
|
||||
// Add include "ESP8266WiFi.h" for this to work
|
||||
if (!WiFi.hostByName(_host.c_str(), remote_addr)) {
|
||||
if (Network.hostByName(_host.c_str(), remote_addr) != 1) {
|
||||
return false;
|
||||
}
|
||||
if(!_client->connect(remote_addr, _port, _connectTimeout)) {
|
||||
|
||||
Reference in new issue
Block a user