I am using libmicrohttpd in my application and am seeing an
unexpected sequence of function calls and am wondering if this is
expected or whether there is something that I've set up
incorrectly.
When initiating the daemon, I am setting callbacks for both
MHD_OPTION_URI_LOG_CALLBACK and MHD_OPTION_NOTIFY_COMPLETED. Then
upon answering the request I am doing a
MHD_create_response_from_callback.
What I'm observing is that the MHD_OPTION_NOTIFY_COMPLETED function
is called before the ContentReaderFreeCallback function from the
response callback. My expectation was that the callback "cleanup"
would have been called before the "notify completed".
The following code snippets may better explain the question. I am
seeing that the 'mhd_deinit' function is
being called before the 'file_free' function.