|Subject:||Re: [lwip-users] Dealloc in fs_close_custom()?|
|Date:||Mon, 26 Feb 2018 22:59:25 +0100|
On 26.02.2018 16:51, Giuseppe Modugno wrote:
I read the examples in lwip-contrib, mainly genfiles_example.c. The
dynamic memory allocated for the file content is freed in
fs_close_custom(). However I couldn't explain why.
Indeed, mostly if the content is small, it is completely sent in
of()/http_close_conn()/http_cl ose_or_abort_conn()/http_state _free()/fs_close()/fs_close_ custom().
tcp_write() is called in http_write() without TCP_WRITE_FLAG_COPY, at
least it seems so to me.
That's not fully correct. The default behaviour is that data is copied for dynamic files (where buf != NULL). This should cover SSI files as well as custom files, but it could be that it doesn't cover your setup of custom files.
You either can adjust the macro HTTP_IS_DATA_VOLATILE() in that case, or come up with a patch that would keep the file open until everything is ACKed.
|[Prev in Thread]||Current Thread||[Next in Thread]|