From 7ec3e0391fcb326017ffc75c9fc76b4ce4d08083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Poczkodi?= Date: Thu, 14 Nov 2024 23:30:06 +0100 Subject: [PATCH] this time for sure --- esphome/components/store_yaml/store_yaml.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/esphome/components/store_yaml/store_yaml.cpp b/esphome/components/store_yaml/store_yaml.cpp index d03fefd47e..b7a7adba88 100644 --- a/esphome/components/store_yaml/store_yaml.cpp +++ b/esphome/components/store_yaml/store_yaml.cpp @@ -66,11 +66,9 @@ void StoreYamlComponent::handleRequest(AsyncWebServerRequest *request) { uint8_t *ptr = buffer; // 5KB+ config file with a single character repeating will result in a 100 byte long word, not likely while (max_len > 100) { + std::string s; if (!this->web_dec_) { this->web_dec_ = make_unique(ESPHOME_YAML, ESPHOME_YAML_SIZE); - } - std::string s; - if (index == 0) { s = this->web_dec_->get_first(); } else { s = this->web_dec_->get_next(); @@ -86,6 +84,7 @@ void StoreYamlComponent::handleRequest(AsyncWebServerRequest *request) { } return ptr - buffer; }; + this->web_dec_ = nullptr; AsyncWebServerResponse *response = request->beginChunkedResponse("text/plain;charset=UTF-8", cb); #else AsyncResponseStream *response = request->beginResponseStream("text/plain;charset=UTF-8");