Next: , Previous: microhttpd-requests, Up: Top


8 Building responses to requests

Response objects handling by MHD is asynchronous with respect to the application execution flow. Instances of the MHD_Response structure are not associated to a daemon and neither to a client connection: they are managed with reference counting.

In the simplest case: we allocate a new MHD_Response structure for each response, we use it once and finally we destroy it.

MHD allows more efficient resources usages.

Example: we allocate a new MHD_Response structure for each response kind, we use it every time we have to give that response and we finally destroy it only when the daemon shuts down.