mirror of
https://github.com/esphome/esphome.git
synced 2025-08-07 19:07:45 +00:00
single ota path
This commit is contained in:
parent
31db6e51eb
commit
1ff7cf1125
@ -100,9 +100,10 @@ void OTARequestHandler::handleUpload(AsyncWebServerRequest *request, const Strin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0 means unknown size for ota_base backends (chunked encoding)
|
// Web server OTA uses multipart uploads where the actual firmware size
|
||||||
size_t ota_size = request->contentLength();
|
// is unknown (contentLength includes multipart overhead)
|
||||||
error_code = this->ota_backend_->begin(ota_size);
|
// Pass 0 to indicate unknown size
|
||||||
|
error_code = this->ota_backend_->begin(0);
|
||||||
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);
|
||||||
this->ota_backend_.reset();
|
this->ota_backend_.reset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user