mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +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:
parent
11daabc9c2
commit
888e315553
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user