I have been looking into this. There is a genfiles example in the lwip source (in contrib/examples) which claims to do dynamically generated files.
The example actually uses a straight memcpy rather than doing any "generation", but the principle is the same.
In that example, since all the file is ready at once, instead of setting file->index to be zero, it sets it to the length of the data.
Then, when fs_read_custom is called, it returns FS_READ_EOF.
I haven't tried this out, because I haven't had time yet, but it might help. Let us know either way. I will be doing something along these lines soon myself soon, and it would be good to know in advance![Smile :)]()
While the httpd stuff is OK, the online documentation isn't as "thorough" as I would like, although I find I am struggling with lack of knowledge on lwip generally, as I was more used to socket-style development. I'm getting there, but it's taking more time than I expected.
The example actually uses a straight memcpy rather than doing any "generation", but the principle is the same.
In that example, since all the file is ready at once, instead of setting file->index to be zero, it sets it to the length of the data.
Then, when fs_read_custom is called, it returns FS_READ_EOF.
I haven't tried this out, because I haven't had time yet, but it might help. Let us know either way. I will be doing something along these lines soon myself soon, and it would be good to know in advance
While the httpd stuff is OK, the online documentation isn't as "thorough" as I would like, although I find I am struggling with lack of knowledge on lwip generally, as I was more used to socket-style development. I'm getting there, but it's taking more time than I expected.
Statistics: Posted by SteveSpencer — Mon Dec 08, 2025 12:24 pm