[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Constants

Enumeration: MHD_FLAG

Options for the MHD daemon.

Note that if neither MHD_USER_THREAD_PER_CONNECTION nor MHD_USE_SELECT_INTERNALLY are used, the client wants control over the process and will call the appropriate microhttpd callbacks.

Starting the daemon may also fail if a particular option is not implemented or not supported on the target platform (i.e. no support for SSL, threads or IPv6).

MHD_NO_FLAG

No options selected.

MHD_USE_DEBUG

Run in debug mode. If this flag is used, the library should print error messages and warnings to stderr. Note that MHD also needs to be compiled with the configure option --enable-messages for this run-time option to have any effect.

MHD_USE_SSL

Run in https mode (this is not yet supported).

MHD_USE_THREAD_PER_CONNECTION

Run using one thread per connection.

MHD_USE_SELECT_INTERNALLY

Run using an internal thread doing SELECT.

MHD_USE_IPv6

Run using the IPv6 protocol (otherwise, MHD will just support IPv4).

MHD_USE_PEDANTIC_CHECKS

Be pedantic about the protocol (as opposed to as tolerant as possible). Specifically, at the moment, this flag causes MHD to reject HTTP 1.1 connections without a Host header. This is required by the standard, but of course in violation of the “be as liberal as possible in what you accept” norm. It is recommended to turn this ON if you are testing clients against MHD, and OFF in production.

Enumeration: MHD_OPTION

MHD options. Passed in the varargs portion of MHD_start_daemon().

MHD_OPTION_END

No more options / last option. This is used to terminate the VARARGs list.

MHD_OPTION_CONNECTION_MEMORY_LIMIT

Maximum memory size per connection (followed by an unsigned int).

MHD_OPTION_CONNECTION_LIMIT

Maximum number of concurrenct connections to accept (followed by an unsigned int).

MHD_OPTION_CONNECTION_TIMEOUT

After how many seconds of inactivity should a connection automatically be timed out? (followed by an unsigned int; use zero for no timeout).

MHD_OPTION_NOTIFY_COMPLETED

Register a function that should be called whenever a request has been completed (this can be used for application-specific clean up). Requests that have never been presented to the application (via MHD_AccessHandlerCallback()) will not result in notifications.

This option should be followed by TWO pointers. First a pointer to a function of type MHD_RequestCompletedCallback() and second a pointer to a closure to pass to the request completed callback. The second pointer maybe NULL.

MHD_OPTION_PER_IP_CONNECTION_LIMIT

Limit on the number of (concurrent) connections made to the server from the same IP address. Can be used to prevent one IP from taking over all of the allowed connections. If the same IP tries to establish more than the specified number of connections, they will be immediately rejected. The option should be followed by an unsigned int. The default is zero, which means no limit on the number of connections from the same IP address.

Enumeration: MHD_ValueKind

The MHD_ValueKind specifies the source of the key-value pairs in the HTTP protocol.

MHD_RESPONSE_HEADER_KIND

Response header.

MHD_HEADER_KIND

HTTP header.

MHD_COOKIE_KIND

Cookies. Note that the original HTTP header containing the cookie(s) will still be available and intact.

MHD_POSTDATA_KIND

POST data. This is available only if a content encoding supported by MHD is used (currently only URL encoding), and only if the posted content fits within the available memory pool. Note that in that case, the upload data given to the MHD_AccessHandlerCallback() will be empty (since it has already been processed).

MHD_GET_ARGUMENT_KIND

GET (URI) arguments.

MHD_HEADER_KIND

HTTP footer (only for http 1.1 chunked encodings).

Enumeration: MHD_RequestTerminationCode

The MHD_RequestTerminationCode specifies reasons why a request has been terminated (or completed).

MHD_REQUEST_TERMINATED_COMPLETED_OK

We finished sending the response.

MHD_REQUEST_TERMINATED_WITH_ERROR

Error handling the connection (resources exhausted, other side closed connection, application error accepting request, etc.)

MHD_REQUEST_TERMINATED_TIMEOUT_REACHED

No activity on the connection for the number of seconds specified using MHD_OPTION_CONNECTION_TIMEOUT.

MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN

We had to close the session since MHD was being shut down.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Christian Grothoff on May, 26 2008 using texi2html 1.78.