-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Status: In ProgressWork is in progressWork is in progress
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
General issue report
- IDF version → v5.5.1
- SoC → ESP32-D0WD (revision v1.1) or ESP32-S3
- OS → Windows
- Build and flash → With the VSCode esp-idf extension
- Power Supply → USB
What is the expected behavior?
To be able to do the same async request more than once
What is the actual behavior?
- The first async response works fine
- The consequent async responses don't work
Steps to reproduce.
- Clone the async_handler example
- Simplify the async for simple testing
static esp_err_t long_async(httpd_req_t* req) {
ESP_LOGI(TAG, "Request URI: %s", req->uri);
esp_err_t err = httpd_resp_sendstr_chunk(req, "test");
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to send string chunk: %s", esp_err_to_name(err));
return err;
}
err = httpd_resp_sendstr_chunk(req, NULL);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to send string chunk: %s", esp_err_to_name(err));
return err;
}
return ESP_OK;
}- Build and flash
- Try
curl http://<ip>/longfor time.- The first time you get a respone
- The second you don't
- The third you do and in the logs it seems to log both 2n and 3r
- The forth gets again stuck
- Now restart and try
curl http://<ip>/longthencurl http://<ip>/quick- Quick gets stuck
Note
Adding httpd_resp_set_hdr(req, "Connection", "close"); seems to fix the problem partially. I found that in my API, if I also don't read the entire body of the POST/PUT request, they get stuck. I'll try replicating in a simple example
Update 1: the POST/PUT problem seems to happen on Windows with chrome/edge. On chrome Android the problem doesn't seem present
Metadata
Metadata
Assignees
Labels
Status: In ProgressWork is in progressWork is in progress