GNU libmicrohttpd
0.9.29
|
Macros | |
#define | MHD_ICY_FLAG ((uint32_t)(1 << 31)) |
Functions | |
int | MHD_quiesce_daemon (struct MHD_Daemon *daemon) |
int | MHD_add_connection (struct MHD_Daemon *daemon, int client_socket, const struct sockaddr *addr, socklen_t addrlen) |
union MHD_ConnectionInfo * | MHD_get_connection_info (struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...) |
int | MHD_set_connection_option (struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...) |
union MHD_DaemonInfo * | MHD_get_daemon_info (struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...) |
const char * | MHD_get_version (void) |
This group includes functions that do not fit into any particular category and that are rarely used.
#define MHD_ICY_FLAG ((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 instad of "HTTP".
Definition at line 258 of file microhttpd.h.
Referenced by build_header_response().
int MHD_add_connection | ( | struct MHD_Daemon * | daemon, |
int | 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_PIPE_FOR_SHUTDOWN 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.
Per-IP connection limits are ignored when using this API.
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. Definition at line 1662 of file daemon.c.
References internal_add_connection(), make_nonblocking_noninheritable(), and MHD_YES.
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 2618 of file connection.c.
References MHD_Connection::addr, MHD_Connection::daemon, MHD_CONNECTION_INFO_CIPHER_ALGO, MHD_CONNECTION_INFO_CLIENT_ADDRESS, MHD_CONNECTION_INFO_CONNECTION_FD, MHD_CONNECTION_INFO_DAEMON, MHD_CONNECTION_INFO_GNUTLS_SESSION, MHD_CONNECTION_INFO_PROTOCOL, NULL, and MHD_Connection::socket_fd.
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 4081 of file daemon.c.
References MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY, MHD_DAEMON_INFO_KEY_SIZE, MHD_DAEMON_INFO_LISTEN_FD, MHD_DAEMON_INFO_MAC_KEY_SIZE, NULL, and MHD_Daemon::socket_fd.
const char * MHD_get_version | ( | void | ) |
int 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_PIPE_FOR_SHUTDOWN 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 -1.
daemon | daemon to stop accepting new connections for |
Definition at line 2692 of file daemon.c.
References MHD_NO, MHD_PANIC, MHD_USE_EPOLL_LINUX_ONLY, MHD_USE_SELECT_INTERNALLY, MHD_YES, NULL, MHD_Daemon::options, MHD_Daemon::socket_fd, MHD_Daemon::worker_pool, MHD_Daemon::worker_pool_size, and MHD_Daemon::wpipe.
int 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 2661 of file connection.c.
References MHD_Daemon::cleanup_connection_mutex, MHD_Connection::connection_timeout, MHD_Daemon::connection_timeout, MHD_Connection::daemon, MHD_Daemon::manual_timeout_head, MHD_Daemon::manual_timeout_tail, MHD_CONNECTION_OPTION_TIMEOUT, MHD_NO, MHD_PANIC, MHD_USE_THREAD_PER_CONNECTION, MHD_YES, MHD_Daemon::normal_timeout_head, MHD_Daemon::normal_timeout_tail, MHD_Daemon::options, XDLL_insert, and XDLL_remove.