Sending large HTTP responses without io_buf #2481
-
I'm working on converting some code to mongoose, but I'm running into a major issue. I can't seem to find a way to send large responses that bypass the IO buffers. I am on esp32 and am having issues with heap size. I have a large (133380 byte) index.html file that is processed and included as a header file like so:
Unfortunately when I go to send this file with any of the mg_http_reply, mg_send, or mg_printf functions I run into issues with allocating more heap:
Just before this call, I checked the heap with DUMP(heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT)); and get something like this.
So clearly my issue is that it cannot allocate a bigger send buffer, but really this file already exists as a stream and doesn't need to be copied, just sent out. Anyone have any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please follow the guidelines in the documentation, examples and tutorials available. |
Beta Was this translation helpful? Give feedback.
Please follow the guidelines in the documentation, examples and tutorials available.
https://mongoose.ws/documentation/tutorials/huge-response/
or
This is TCP, it is streaming, just split your whatever in pieces that will fit, or, put your file in a file system and let the file system do your job.