GNU libmicrohttpd
0.9.72
|
Macros | |
#define | MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31)) |
Functions | |
_MHD_EXTERN MHD_socket | MHD_quiesce_daemon (struct MHD_Daemon *daemon) |
_MHD_EXTERN enum MHD_Result | MHD_add_connection (struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen) |
_MHD_EXTERN const union MHD_ConnectionInfo * | MHD_get_connection_info (struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...) |
_MHD_EXTERN enum MHD_Result | MHD_set_connection_option (struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...) |
_MHD_EXTERN const union MHD_DaemonInfo * | MHD_get_daemon_info (struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...) |
_MHD_EXTERN const char * | MHD_get_version (void) |
_MHD_EXTERN enum MHD_Result | MHD_is_feature_supported (enum MHD_FEATURE feature) |
enum MHD_StatusCode | MHD_daemon_add_connection (struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen) |
enum MHD_Bool | MHD_connection_get_information_sz (struct MHD_Connection *connection, enum MHD_ConnectionInformationType info_type, union MHD_ConnectionInformation *return_value, size_t return_value_size) |
enum MHD_Bool | MHD_daemon_get_information_sz (struct MHD_Daemon *daemon, enum MHD_DaemonInformationType info_type, union MHD_DaemonInformation *return_value, size_t return_value_size) |
MHD_socket | MHD_daemon_quiesce (struct MHD_Daemon *daemon) |
enum MHD_Bool | MHD_request_get_information_sz (struct MHD_Request *request, enum MHD_RequestInformationType info_type, union MHD_RequestInformation *return_value, size_t return_value_size) |
_MHD_EXTERN enum MHD_Bool | MHD_is_feature_supported (enum MHD_Feature feature) |
This group includes functions that do not fit into any particular category and that are rarely used.
#define MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31)) |
Flag to be or-ed with MHD_HTTP status code for SHOUTcast. This will cause the response to begin with the SHOUTcast "ICY" line instead of "HTTP".
Definition at line 537 of file microhttpd.h.
enum MHD_Result MHD_add_connection | ( | struct MHD_Daemon * | daemon, |
MHD_socket | client_socket, | ||
const struct sockaddr * | addr, | ||
socklen_t | addrlen | ||
) |
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, or if you are building a proxy.
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 the freshly added connection is immediately processed by MHD.
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 | daemon that manages the connection |
client_socket | socket to manage (MHD will expect to receive an HTTP request from this socket next). |
addr | IP address of the client |
addrlen | number of bytes in addr |
malloc()
failed, etc). The socket will be closed in any case; errno
is set to indicate further details about the error.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, or if you are building a proxy.
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 the freshly added connection is immediately processed by MHD.
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 | daemon that manages the connection |
client_socket | socket to manage (MHD will expect to receive an HTTP request from this socket next). |
addr | IP address of the client |
addrlen | number of bytes in addr |
enum MHD_Bool MHD_connection_get_information_sz | ( | struct MHD_Connection * | connection, |
enum MHD_ConnectionInformationType | info_type, | ||
union MHD_ConnectionInformation * | return_value, | ||
size_t | return_value_size | ||
) |
Obtain information about the given connection. Use wrapper macro #MHD_connection_get_information() instead of direct use of this function.
connection | what connection to get information about | |
info_type | what information is desired? | |
[out] | return_value | pointer to union where requested information will be stored |
return_value_size | size of union MHD_ConnectionInformation at compile time |
Definition at line 1 of file connection_info.c.
References MHD_Connection::addr, CHECK_SIZE, MHD_Connection::connection_timeout, MHD_Connection::daemon, MHD_NO, MHD_YES, NULL, MHD_Connection::socket_context, MHD_Connection::socket_fd, and MHD_Connection::suspended.
enum MHD_StatusCode MHD_daemon_add_connection | ( | struct MHD_Daemon * | daemon, |
MHD_socket | client_socket, | ||
const struct sockaddr * | addr, | ||
socklen_t | addrlen | ||
) |
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, or if you are building a proxy.
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 the freshly added connection is immediately processed by MHD.
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 | daemon that manages the connection |
client_socket | socket to manage (MHD will expect to receive an HTTP request from this socket next). |
addr | IP address of the client |
addrlen | number of bytes in addr |
errno
is set to indicate further details about the error. Definition at line 521 of file connection_add.c.
enum MHD_Bool MHD_daemon_get_information_sz | ( | struct MHD_Daemon * | daemon, |
enum MHD_DaemonInformationType | info_type, | ||
union MHD_DaemonInformation * | return_value, | ||
size_t | return_value_size | ||
) |
Obtain information about the given daemon. Use wrapper macro #MHD_daemon_get_information() instead of direct use of this function.
daemon | what daemon to get information about | |
info_type | what information is desired? | |
[out] | return_value | pointer to union where requested information will be stored |
return_value_size | size of union MHD_DaemonInformation at compile time |
Definition at line 1 of file daemon_info.c.
References CHECK_SIZE, MHD_Daemon::connections, MHD_Daemon::listen_port, MHD_Daemon::listen_socket, MHD_connection_cleanup_(), MHD_NO, MHD_YES, MHD_Daemon::threading_mode, MHD_Daemon::worker_pool, and MHD_Daemon::worker_pool_size.
MHD_socket MHD_daemon_quiesce | ( | struct MHD_Daemon * | daemon | ) |
Stop accepting connections from the listening socket. Allows clients to continue processing, but stops accepting new connections. Note that the caller is responsible for closing the returned socket; however, if MHD is run using threads (anything but external select mode), it must not be closed until AFTER MHD_stop_daemon has been called (as it is theoretically possible that an existing thread is still using it).
Note that some thread modes require the caller to have passed MHD_USE_ITC when using this API. If this daemon is in one of those modes and this option was not given to MHD_start_daemon, this function will return MHD_INVALID_SOCKET.
daemon | daemon to stop accepting new connections for |
Definition at line 49 of file daemon_quiesce.c.
References _, MHD_Daemon::disable_itc, MHD_Daemon::event_loop_syscall, MHD_Daemon::itc, MHD_Daemon::listen_socket, MHD_INVALID_SOCKET, MHD_PANIC, NULL, MHD_Daemon::threading_mode, MHD_Daemon::was_quiesced, MHD_Daemon::worker_pool, and MHD_Daemon::worker_pool_size.
const union MHD_ConnectionInfo * MHD_get_connection_info | ( | struct MHD_Connection * | connection, |
enum MHD_ConnectionInfoType | info_type, | ||
... | |||
) |
Obtain information about the given connection.
connection | what connection to get information about |
info_type | what information is desired? |
... | depends on info_type |
Definition at line 3793 of file connection.c.
References MHD_Connection::addr, MHD_Connection::connection_timeout, MHD_Connection::connection_timeout_dummy, MHD_Connection::daemon, MHD_Connection::header_size, MHD_CONNECTION_CLOSED, MHD_CONNECTION_HEADERS_RECEIVED, MHD_CONNECTION_INFO_CIPHER_ALGO, MHD_CONNECTION_INFO_CLIENT_ADDRESS, MHD_CONNECTION_INFO_CONNECTION_FD, MHD_CONNECTION_INFO_CONNECTION_SUSPENDED, MHD_CONNECTION_INFO_CONNECTION_TIMEOUT, MHD_CONNECTION_INFO_DAEMON, MHD_CONNECTION_INFO_GNUTLS_SESSION, MHD_CONNECTION_INFO_PROTOCOL, MHD_CONNECTION_INFO_REQUEST_HEADER_SIZE, MHD_CONNECTION_INFO_SOCKET_CONTEXT, MHD_NO, MHD_YES, NULL, MHD_Connection::socket_context, MHD_Connection::socket_fd, MHD_Connection::state, MHD_Connection::suspended, and MHD_Connection::suspended_dummy.
const union MHD_DaemonInfo * MHD_get_daemon_info | ( | struct MHD_Daemon * | daemon, |
enum MHD_DaemonInfoType | info_type, | ||
... | |||
) |
Obtain information about the given daemon (not fully implemented!).
daemon | what daemon to get information about |
info_type | what information is desired? |
... | depends on info_type |
Definition at line 7500 of file daemon.c.
References MHD_Daemon::connections, MHD_Daemon::listen_fd, MHD_cleanup_connections(), MHD_DAEMON_INFO_BIND_PORT, MHD_DAEMON_INFO_CURRENT_CONNECTIONS, MHD_DAEMON_INFO_EPOLL_FD, MHD_DAEMON_INFO_FLAGS, MHD_DAEMON_INFO_KEY_SIZE, MHD_DAEMON_INFO_LISTEN_FD, MHD_DAEMON_INFO_MAC_KEY_SIZE, MHD_USE_INTERNAL_POLLING_THREAD, NULL, MHD_Daemon::options, MHD_Daemon::port, MHD_Daemon::worker_pool, and MHD_Daemon::worker_pool_size.
const char * MHD_get_version | ( | void | ) |
Obtain the version of this library
Definition at line 35 of file version.c.
References MHD_VERSION.
_MHD_EXTERN enum MHD_Bool MHD_is_feature_supported | ( | enum MHD_Feature | feature | ) |
Get information about supported MHD features. Indicate that MHD was compiled with or without support for particular feature. Some features require additional support by kernel. Kernel support is not checked by this function.
feature | type of requested information |
Definition at line 68 of file version.c.
References MHD_FEATURE_AUTODETECT_BIND_PORT, MHD_FEATURE_AUTOSUPPRESS_SIGPIPE, MHD_FEATURE_BASIC_AUTH, MHD_FEATURE_DIGEST_AUTH, MHD_FEATURE_EPOLL, MHD_FEATURE_HTTPS_CERT_CALLBACK, MHD_FEATURE_HTTPS_KEY_PASSWORD, MHD_FEATURE_IPv6, MHD_FEATURE_IPv6_ONLY, MHD_FEATURE_LARGE_FILE, MHD_FEATURE_MESSAGES, MHD_FEATURE_POLL, MHD_FEATURE_POSTPROCESSOR, MHD_FEATURE_RESPONSES_SHARED_FD, MHD_FEATURE_SENDFILE, MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET, MHD_FEATURE_SOCKETPAIR, MHD_FEATURE_TCP_FASTOPEN, MHD_FEATURE_THREAD_NAMES, MHD_FEATURE_TLS, MHD_FEATURE_UPGRADE, MHD_NO, and MHD_YES.
enum MHD_Result MHD_is_feature_supported | ( | enum MHD_FEATURE | feature | ) |
Get information about supported MHD features. Indicate that MHD was compiled with or without support for particular feature. Some features require additional support by kernel. Kernel support is not checked by this function.
feature | type of requested information |
Definition at line 7581 of file daemon.c.
References MHD_VERSION.
MHD_socket MHD_quiesce_daemon | ( | struct MHD_Daemon * | daemon | ) |
Stop accepting connections from the listening socket. Allows clients to continue processing, but stops accepting new connections. Note that the caller is responsible for closing the returned socket; however, if MHD is run using threads (anything but external select mode), it must not be closed until AFTER MHD_stop_daemon has been called (as it is theoretically possible that an existing thread is still using it).
Note that some thread modes require the caller to have passed MHD_USE_ITC when using this API. If this daemon is in one of those modes and this option was not given to MHD_start_daemon, this function will return MHD_INVALID_SOCKET.
daemon | daemon to stop accepting new connections for |
Stop accepting connections from the listening socket. Allows clients to continue processing, but stops accepting new connections. Note that the caller is responsible for closing the returned socket; however, if MHD is run using threads (anything but external select mode), socket will be removed from existing threads with some delay and it must not be closed while it's in use. To make sure that the socket is not used anymore, call MHD_stop_daemon.
Note that some thread modes require the caller to have passed MHD_USE_ITC when using this API. If this daemon is in one of those modes and this option was not given to MHD_start_daemon, this function will return MHD_INVALID_SOCKET.
daemon | daemon to stop accepting new connections for |
Definition at line 5250 of file daemon.c.
References _, MHD_Daemon::itc, MHD_Daemon::listen_fd, MHD_INVALID_SOCKET, MHD_PANIC, MHD_USE_EPOLL, MHD_USE_INTERNAL_POLLING_THREAD, MHD_USE_ITC, NULL, MHD_Daemon::options, MHD_Daemon::was_quiesced, MHD_Daemon::worker_pool, and MHD_Daemon::worker_pool_size.
enum MHD_Bool MHD_request_get_information_sz | ( | struct MHD_Request * | request, |
enum MHD_RequestInformationType | info_type, | ||
union MHD_RequestInformation * | return_value, | ||
size_t | return_value_size | ||
) |
Obtain information about the given request. Use wrapper macro #MHD_request_get_information() instead of direct use of this function.
request | what request to get information about | |
info_type | what information is desired? | |
[out] | return_value | pointer to union where requested information will be stored |
return_value_size | size of union MHD_RequestInformation at compile time |
Definition at line 1 of file request_info.c.
References CHECK_SIZE, MHD_Request::client_context, MHD_Request::connection, MHD_Request::header_size, MHD_Request::method_s, MHD_NO, MHD_REQUEST_CLOSED, MHD_REQUEST_HEADERS_RECEIVED, MHD_YES, MHD_Request::state, and MHD_Request::version_s.
enum MHD_Result MHD_set_connection_option | ( | struct MHD_Connection * | connection, |
enum MHD_CONNECTION_OPTION | option, | ||
... | |||
) |
Set a custom option for the given connection, overriding defaults.
connection | connection to modify |
option | option to set |
... | arguments to the option, depending on the option type |
Definition at line 3793 of file connection.c.