MHD_Daemon Struct Reference

#include </builddir/build/BUILD/libmicrohttpd-0.9.33/src/microhttpd/internal.h>

Data Fields

MHD_AccessHandlerCallback default_handler
void * default_handler_cls
struct MHD_Connectionconnections_head
struct MHD_Connectionconnections_tail
struct MHD_Connectionsuspended_connections_head
struct MHD_Connectionsuspended_connections_tail
struct MHD_Connectioncleanup_head
struct MHD_Connectioncleanup_tail
struct MHD_Connectionnormal_timeout_head
struct MHD_Connectionnormal_timeout_tail
struct MHD_Connectionmanual_timeout_head
struct MHD_Connectionmanual_timeout_tail
MHD_AcceptPolicyCallback apc
void * apc_cls
MHD_RequestCompletedCallback notify_completed
void * notify_completed_cls
LogCallback uri_log_callback
void * uri_log_callback_cls
UnescapeCallback unescape_callback
void * unescape_callback_cls
struct MHD_Daemonmaster
struct MHD_Daemonworker_pool
void * per_ip_connection_count
size_t pool_size
size_t pool_increment
size_t thread_stack_size
unsigned int worker_pool_size
pthread_t pid
pthread_mutex_t per_ip_connection_mutex
pthread_mutex_t cleanup_connection_mutex
int socket_fd
int wpipe [2]
int shutdown
int resuming
unsigned int max_connections
unsigned int connection_timeout
unsigned int per_ip_connection_limit
enum MHD_OPTION options
uint16_t port

Detailed Description

State kept for each MHD daemon. All connections are kept in two doubly-linked lists. The first one reflects the state of the connection in terms of what operations we are waiting for (read, write, locally blocked, cleanup) whereas the second is about its timeout state (default or custom).

Definition at line 885 of file internal.h.


Field Documentation

Function to call to check if we should accept or reject an incoming request. May be NULL.

Definition at line 977 of file internal.h.

Referenced by internal_add_connection(), and MHD_start_daemon_va().

Closure argument to apc.

Definition at line 982 of file internal.h.

Referenced by internal_add_connection(), and MHD_start_daemon_va().

Head of doubly-linked list of connections to clean up.

Definition at line 921 of file internal.h.

Referenced by cleanup_connection(), close_connection(), and MHD_cleanup_connections().

Tail of doubly-linked list of connections to clean up.

Definition at line 926 of file internal.h.

Referenced by cleanup_connection(), close_connection(), and MHD_cleanup_connections().

Head of doubly-linked list of our current, active connections.

Definition at line 901 of file internal.h.

Referenced by cleanup_connection(), close_all_connections(), close_connection(), internal_add_connection(), MHD_get_fdset(), MHD_run_from_select(), MHD_suspend_connection(), and resume_suspended_connections().

Tail of doubly-linked list of our current, active connections.

Definition at line 906 of file internal.h.

Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_suspend_connection(), and resume_suspended_connections().

Callback function for all requests.

Definition at line 891 of file internal.h.

Referenced by call_connection_handler(), MHD_start_daemon_va(), and process_request_body().

Closure argument to default_handler.

Definition at line 896 of file internal.h.

Referenced by MHD_start_daemon_va().

Head of the XDLL of ALL connections with a non-default/custom timeout, unsorted. MHD will do a O(n) scan over this list to determine the current timeout.

Definition at line 965 of file internal.h.

Referenced by cleanup_connection(), close_connection(), MHD_get_timeout(), MHD_set_connection_option(), MHD_suspend_connection(), and resume_suspended_connections().

Tail of the XDLL of ALL connections with a non-default/custom timeout, unsorted.

Definition at line 971 of file internal.h.

Referenced by cleanup_connection(), close_connection(), MHD_set_connection_option(), MHD_suspend_connection(), and resume_suspended_connections().

Pointer to master daemon (NULL if this is the master)

Definition at line 1035 of file internal.h.

Referenced by MHD_get_master(), and MHD_start_daemon_va().

Limit on the number of parallel connections.

Definition at line 1121 of file internal.h.

Referenced by internal_add_connection(), MHD_cleanup_connections(), MHD_select(), MHD_start_daemon_va(), and parse_options_va().

Head of the XDLL of ALL connections with a default ('normal') timeout, sorted by timeout (earliest at the tail, most recently used connection at the head). MHD can just look at the tail of this list to determine the timeout for all of its elements; whenever there is an event of a connection, the connection is moved back to the tail of the list.

All connections by default start in this list; if a custom timeout that does not match 'connection_timeout' is set, they are moved to the 'manual_timeout_head'-XDLL.

Definition at line 952 of file internal.h.

Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_get_timeout(), MHD_set_connection_option(), MHD_suspend_connection(), resume_suspended_connections(), and update_last_activity().

Tail of the XDLL of ALL connections with a default timeout, sorted by timeout (earliest timeout at the tail).

Definition at line 958 of file internal.h.

Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_set_connection_option(), MHD_suspend_connection(), resume_suspended_connections(), and update_last_activity().

Function to call when we are done processing a particular request. May be NULL.

Definition at line 988 of file internal.h.

Referenced by MHD_connection_close(), MHD_connection_handle_idle(), and parse_options_va().

Closure argument to notify_completed.

Definition at line 993 of file internal.h.

Referenced by MHD_connection_close(), MHD_connection_handle_idle(), and parse_options_va().

Table storing number of connections per IP

Definition at line 1045 of file internal.h.

Referenced by MHD_ip_limit_add(), and MHD_ip_limit_del().

Maximum number of connections per IP, or 0 for unlimited.

Definition at line 1133 of file internal.h.

Referenced by MHD_ip_limit_add(), MHD_ip_limit_del(), and parse_options_va().

Mutex for per-IP connection counts.

Definition at line 1075 of file internal.h.

Referenced by MHD_ip_count_lock(), MHD_ip_count_unlock(), MHD_start_daemon_va(), and MHD_stop_daemon().

pthread_t MHD_Daemon::pid

PID of the select thread (if we have internal select)

Definition at line 1070 of file internal.h.

Referenced by MHD_start_daemon_va(), and MHD_stop_daemon().

Increment for growth of the per-connection memory pools.

Definition at line 1055 of file internal.h.

Referenced by MHD_connection_handle_read(), MHD_start_daemon_va(), and parse_options_va().

Size of the per-connection memory pools.

Definition at line 1050 of file internal.h.

Referenced by internal_add_connection(), MHD_start_daemon_va(), parse_options_va(), try_grow_read_buffer(), and try_ready_chunked_body().

uint16_t MHD_Daemon::port

Listen port.

Definition at line 1143 of file internal.h.

Referenced by MHD_start_daemon_va().

Definition at line 1116 of file internal.h.

Referenced by MHD_resume_connection(), and resume_suspended_connections().

Are we shutting down?

Definition at line 1111 of file internal.h.

Referenced by MHD_get_fdset(), MHD_handle_connection(), MHD_poll(), MHD_run(), MHD_select(), MHD_select_thread(), and MHD_stop_daemon().

Head of doubly-linked list of our current but suspended connections.

Definition at line 911 of file internal.h.

Referenced by cleanup_connection(), MHD_suspend_connection(), and resume_suspended_connections().

Tail of doubly-linked list of our current but suspended connections.

Definition at line 916 of file internal.h.

Referenced by cleanup_connection(), MHD_suspend_connection(), and resume_suspended_connections().

Size of threads created by MHD.

Definition at line 1060 of file internal.h.

Referenced by create_thread(), and parse_options_va().

Function to call when we unescape escape sequences.

Definition at line 1012 of file internal.h.

Referenced by check_argument_match(), MHD_start_daemon_va(), parse_arguments(), parse_initial_message_line(), and parse_options_va().

Closure for unescape callback.

Definition at line 1017 of file internal.h.

Referenced by check_argument_match(), parse_arguments(), parse_initial_message_line(), and parse_options_va().

Function to call with the full URI at the beginning of request processing. May be NULL.

Returns the initial pointer to internal state kept by the client for the request.

Definition at line 1002 of file internal.h.

Referenced by parse_initial_message_line(), and parse_options_va().

Closure argument to uri_log_callback.

Definition at line 1007 of file internal.h.

Referenced by parse_initial_message_line(), and parse_options_va().

Worker daemons (one per thread)

Definition at line 1040 of file internal.h.

Referenced by internal_add_connection(), MHD_quiesce_daemon(), MHD_start_daemon_va(), and MHD_stop_daemon().

Number of worker daemons

Definition at line 1065 of file internal.h.

Referenced by internal_add_connection(), MHD_quiesce_daemon(), MHD_start_daemon_va(), MHD_stop_daemon(), and parse_options_va().

Pipe we use to signal shutdown, unless 'HAVE_LISTEN_SHUTDOWN' is defined AND we have a listen socket (which we can then 'shutdown' to stop listening). On W32 this is a socketpair, not a pipe.

Definition at line 1106 of file internal.h.

Referenced by internal_add_connection(), MHD_quiesce_daemon(), MHD_resume_connection(), MHD_run_from_select(), MHD_select(), MHD_start_daemon_va(), and MHD_stop_daemon().


The documentation for this struct was generated from the following file:

Generated on 15 Oct 2014 for GNU libmicrohttpd by  doxygen 1.6.1