Fix infinite loop in http_request for ESP-IDF. (#6963)

This commit is contained in:
Kevin P. Fleming 2024-06-21 17:18:43 -04:00 committed by Jesse Hills
parent 7dbc20b776
commit ae2962259e
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -90,7 +90,7 @@ std::shared_ptr<HttpContainer> 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;