mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
[ota] Only delay(1) on EWOULDBLOCK in writeall_, feed WDT on success
This commit is contained in:
@@ -459,10 +459,13 @@ bool ESPHomeOTAComponent::writeall_(const uint8_t *buf, size_t len) {
|
||||
ESP_LOGW(TAG, "Write err %zu bytes, errno %d", len, errno);
|
||||
return false;
|
||||
}
|
||||
// EWOULDBLOCK: on raw TCP writes never block, delay(1) prevents spinning
|
||||
this->yield_and_feed_watchdog_();
|
||||
} else {
|
||||
at += written;
|
||||
// write() may block up to SO_SNDTIMEO on BSD/lwip sockets, feed WDT
|
||||
App.feed_wdt();
|
||||
}
|
||||
this->yield_and_feed_watchdog_();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user