GNU libmicrohttpd  0.9.72
action_suspend.c File Reference

implementation of MHD_action_suspend() More...

#include "internal.h"
Include dependency graph for action_suspend.c:

Go to the source code of this file.

Functions

static enum MHD_StatusCode suspend_action (void *cls, struct MHD_Request *request)
 
const struct MHD_ActionMHD_action_suspend (void)
 

Detailed Description

implementation of MHD_action_suspend()

Author
Christian Grothoff

Definition in file action_suspend.c.

Function Documentation

◆ MHD_action_suspend()

const struct MHD_Action* MHD_action_suspend ( void  )

Suspend handling of network data for a given request. This can be used to dequeue a request from MHD's event loop for a while.

If you use this API in conjunction with a internal select or a thread pool, you must set the option MHD_USE_ITC to ensure that a resumed request is immediately processed by MHD.

Suspended requests continue to count against the total number of requests allowed (per daemon, as well as per IP, if such limits are set). Suspended requests will NOT time out; timeouts will restart when the request handling is resumed. While a request is suspended, MHD will not detect disconnects by the client.

The only safe time to suspend a request is from either a #MHD_RequestHeaderCallback, #MHD_UploadCallback, or a #MHD_RequestfetchResponseCallback. Suspending a request at any other time will cause an assertion failure.

Finally, it is an API violation to call #MHD_daemon_stop() while having suspended requests (this will at least create memory and socket leaks or lead to undefined behavior). You must explicitly resume all requests before stopping the daemon.

Returns
action to cause a request to be suspended.

Definition at line 127 of file action_suspend.c.

References MHD_Action::action, NULL, and suspend_action().

Here is the call graph for this function:

◆ suspend_action()