Set a handler for fatal errors.
- function to call if MHD encounters a fatal internal error. If no handler was set explicitly, MHD will call
- closure argument for cb; the other arguments are the name of the source file, line number and a string describing the nature of the fatal error (which can be
Start a webserver on the given port.
- OR-ed combination of
- port to bind to;
- callback to call to check which clients will be allowed to connect; you can pass
NULLin which case connections from any IP will be accepted;
- extra argument to apc;
- default handler for all URIs;
- extra argument to dh.
Additional arguments are a list of options (type-value pairs, terminated with
MHD_OPTION_END). It is mandatory to use
MHD_OPTION_ENDas last argument, even when there are no additional arguments.
NULLon error, handle to daemon on success.
Run webserver operations (without blocking unless in client callbacks). This method should be called by clients in combination with
MHD_get_fdset()if the client-controlled
select-method is used.
MHD_NOif this daemon was not started with the right options for this call.
Add another client connection to the set of connections managed by MHD. This API is usually not needed (since MHD will accept inbound connections on the server socket). Use this API in special cases, for example if your HTTP server is behind NAT and needs to connect out to the HTTP client.
The given client socket will be managed (and closed!) by MHD after this call and must no longer be used directly by the application afterwards.
- daemon that manages the connection
- socket to manage (MHD will expect to receive an HTTP request from this socket next).
- IP address of the client
- number of bytes in addr
This function will return
MHD_NOif this daemon could not handle the connection (i.e. malloc failed, etc). The socket will be closed in any case.