1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 12:22:20 +01:00

Fix OTA crash during reading of new bin file. (#2366)

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
This commit is contained in:
Maurice Makaay
2021-09-22 10:37:46 +02:00
committed by GitHub
parent 11daabc9c2
commit 888e315553

View File

@@ -388,8 +388,10 @@ void OTAComponent::handle_() {
size_t requested = std::min(sizeof(buf), ota_size - total);
ssize_t read = this->client_->read(buf, requested);
if (read == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
if (errno == EAGAIN || errno == EWOULDBLOCK) {
delay(1);
continue;
}
ESP_LOGW(TAG, "Error receiving data for update, errno: %d", errno);
goto error;
}