From 67bd5db6d6eb6c23e44b430200fefa9a371e2491 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Fri, 21 Jun 2024 17:18:43 -0400 Subject: [PATCH] Fix infinite loop in http_request for ESP-IDF. (#6963) --- esphome/components/http_request/http_request_idf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/http_request/http_request_idf.cpp b/esphome/components/http_request/http_request_idf.cpp index 138e0438f4..d6fac7a133 100644 --- a/esphome/components/http_request/http_request_idf.cpp +++ b/esphome/components/http_request/http_request_idf.cpp @@ -90,7 +90,7 @@ std::shared_ptr HttpRequestIDF::start(std::string url, std::strin int write_left = body_len; int write_index = 0; const char *buf = body.c_str(); - while (body_len > 0) { + while (write_left > 0) { int written = esp_http_client_write(client, buf + write_index, write_left); if (written < 0) { err = ESP_FAIL;