2021-07-22 11:13 PM
The problem is with LwIP codes. I know that the topic is a bit different from this forum. But I ask, maybe someone had similar :)
When I use custom_file with the LWIP_HTTPD_DYNAMIC_FILE_READ flag, the data is sent to the browser twice.
I was looking at the code from the httpd.c file and it seems to me that in the http_init_file function around line 2358
is
if (file-> is_custom_file && (file-> data == NULL) ) {
and I think it should be
if (file-> is_custom_file) {
Can anyone confirm this?
Grzegorz
2021-08-17 06:28 AM
Hello @Community member ,
Can you provide the stm32 MCU used and the LwIP version?
Thanks in advance.
BeST Regards,
Walid
2021-08-17 06:45 AM
You can compare with the latest LwIP version here.
Unlikely that they still have a bug.
2021-08-18 02:29 AM
Hello @Community member ,
The issue has been raised internally.
Thank you for reporting this out.
BeST Regards,
Walid
2021-08-18 02:29 AM
ST Internal Reference: 112036
2022-02-24 05:20 AM
Hello, is there any solution ?
2022-02-24 05:59 AM
Hello again, Solution:
you need to set the file->data = NULL in fs_open_custom().
then everything works fine !
Would be great to find this solution somewhere in the documentation.
2022-02-26 04:13 AM
Hi
I found it possible to do this, but it is not a good solution. You cannot use the file-> data pointer as the actual pointer to an open pseudo-file because it must be NULL. The pointer to the open file must be saved in an external variable. It would be nice to use the file->data pointer for this. I was reviewing the code in terms of this possibility: the place I indicated earlier is the only one that would need to be changed. The rest is fine.