Skip to content

Commit 6ac4ea4

Browse files
committed
Adapt logic to feed scheduled recurrent functions in hostByName from PR esp8266#6212
1 parent 7417970 commit 6ac4ea4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,12 @@ int ESP8266WiFiGenericClass::hostByName(const char* aHostname, IPAddress& aResul
616616
aResult = IPAddress(&addr);
617617
} else if(err == ERR_INPROGRESS) {
618618
_dns_lookup_pending = true;
619-
esp_delay(timeout_ms, []() { return _dns_lookup_pending; });
620-
// will resume on timeout or when wifi_dns_found_callback fires
619+
// Will resume on timeout or when wifi_dns_found_callback fires.
620+
// The final argument, intvl_ms, to esp_delay influences how frequently
621+
// the scheduled recurrent functions (Schedule.h) are probed; here, to allow
622+
// the ethernet driver perform work.
623+
esp_delay(timeout_ms, []() { return _dns_lookup_pending; }, 1);
621624
_dns_lookup_pending = false;
622-
// will return here when dns_found_callback fires
623625
if(aResult.isSet()) {
624626
err = ERR_OK;
625627
}

0 commit comments

Comments
 (0)