mirror of
https://github.com/esphome/esphome.git
synced 2025-09-12 08:12:22 +01:00
single ota path
This commit is contained in:
@@ -100,12 +100,8 @@ void OTARequestHandler::handleUpload(AsyncWebServerRequest *request, const Strin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0 means unknown size for ota_base backends (chunked encoding)
|
||||||
size_t ota_size = request->contentLength();
|
size_t ota_size = request->contentLength();
|
||||||
if (ota_size == 0) {
|
|
||||||
// For chunked encoding, we don't know the size
|
|
||||||
ota_size = UPDATE_SIZE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_code = this->ota_backend_->begin(ota_size);
|
error_code = this->ota_backend_->begin(ota_size);
|
||||||
if (error_code != ota_base::OTA_RESPONSE_OK) {
|
if (error_code != ota_base::OTA_RESPONSE_OK) {
|
||||||
ESP_LOGE(TAG, "OTA begin failed: %d", error_code);
|
ESP_LOGE(TAG, "OTA begin failed: %d", error_code);
|
||||||
|
Reference in New Issue
Block a user