Closed fgrfl closed 3 weeks ago
Were you able to reproduce the issue? Do you want me to create a PR with the proposed patch?
Hello @fgrfl Thanks for raising the issue. I was able to reproduce the issue. The patch you shared seems to fix the issue as well. If you want you could create a PR or else I can create an internal MR with the fix you provided. Thanks!
I've signed the CLA and created a PR
same problem here with HTTP_POST. your patch fixes it. @fgrfl :+1:
Answers checklist.
IDF version.
5.2.1
Espressif SoC revision.
ESP32-D0WD (revision v1.0), ESP32-S3 (QFN56) (revision v0.1)
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Custom Board,
Power Supply used.
External 3.3V
What is the expected behavior?
I expected to receive a large file in a PUT request URI handler that runs in an asynchronous context
What is the actual behavior?
The function
httpd_req_recv
returns no data, butHTTPD_SOCK_ERR_TIMEOUT
, even thoughhttpd_req_t::content_len
indicates there are 338476 bytes to read.Steps to reproduce.
change the method of the long handler to HTTP_PUT and replace the sending part of
static esp_err_t long_async_handler(httpd_req_t *req)
with the following receiving code:More Information.
I tested it with IDF-5.2.1, but I have applied the patch from https://github.com/espressif/esp-idf/issues/13430
With this additional patch, it works fine, PUT requests with a large file as payload are handled correctly in the asynchronous handler and the main httpd task doesn't try to "steal" data from that socket: