GNU libmicrohttpd
0.9.29
|
internal shared structures More...
Go to the source code of this file.
Data Structures | |
struct | MHD_NonceNc |
struct | MHD_HTTP_Header |
struct | MHD_Response |
struct | MHD_Connection |
struct | MHD_Daemon |
Macros | |
#define | EXTRA_CHECKS MHD_NO |
#define | MHD_MAX(a, b) ((a)<(b)) ? (b) : (a) |
#define | MHD_MIN(a, b) ((a)<(b)) ? (a) : (b) |
#define | MHD_BUF_INC_SIZE 1024 |
#define | MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL) |
#define | MAX_NONCE_LENGTH 129 |
#define | DEBUG_STATES MHD_NO |
#define | EXTRA_CHECK(a) |
#define | DLL_insert(head, tail, element) |
#define | DLL_remove(head, tail, element) |
#define | XDLL_insert(head, tail, element) |
#define | XDLL_remove(head, tail, element) |
#define | EDLL_insert(head, tail, element) |
#define | EDLL_remove(head, tail, element) |
Typedefs | |
typedef ssize_t(* | ReceiveCallback )(struct MHD_Connection *conn, void *write_to, size_t max_bytes) |
typedef ssize_t(* | TransmitCallback )(struct MHD_Connection *conn, const void *write_to, size_t max_bytes) |
typedef void *(* | LogCallback )(void *cls, const char *uri, struct MHD_Connection *con) |
typedef size_t(* | UnescapeCallback )(void *cls, struct MHD_Connection *conn, char *uri) |
Functions | |
size_t | MHD_http_unescape (void *cls, struct MHD_Connection *connection, char *val) |
time_t | MHD_monotonic_time (void) |
Variables | |
MHD_PanicCallback | mhd_panic |
void * | mhd_panic_cls |
internal shared structures
Definition in file internal.h.
#define DEBUG_STATES MHD_NO |
Should all state transitions be printed to stderr?
Definition at line 469 of file internal.h.
#define DLL_insert | ( | head, | |
tail, | |||
element | |||
) |
Insert an element at the head of a DLL. Assumes that head, tail and element are structs with prev and next fields.
head | pointer to the head of the DLL |
tail | pointer to the tail of the DLL |
element | element to insert |
Definition at line 1247 of file internal.h.
Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_suspend_connection(), resume_suspended_connections(), SPDYF_session_accept(), SPDYF_session_close(), and SPDYF_stream_new().
#define DLL_remove | ( | head, | |
tail, | |||
element | |||
) |
Remove an element from a DLL. Assumes that head, tail and element are structs with prev and next fields.
head | pointer to the head of the DLL |
tail | pointer to the tail of the DLL |
element | element to remove |
Definition at line 1266 of file internal.h.
Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_cleanup_connections(), MHD_suspend_connection(), resume_suspended_connections(), spdyf_cleanup_sessions(), SPDYF_session_close(), SPDYF_session_destroy(), and SPDYF_session_write().
#define EDLL_insert | ( | head, | |
tail, | |||
element | |||
) |
Insert an element at the head of a EDLL. Assumes that head, tail and element are structs with prevE and nextE fields.
head | pointer to the head of the EDLL |
tail | pointer to the tail of the EDLL |
element | element to insert |
Definition at line 1328 of file internal.h.
Referenced by internal_add_connection(), MHD_connection_handle_idle(), and resume_suspended_connections().
#define EDLL_remove | ( | head, | |
tail, | |||
element | |||
) |
Remove an element from a EDLL. Assumes that head, tail and element are structs with prevE and nextE fields.
head | pointer to the head of the EDLL |
tail | pointer to the tail of the EDLL |
element | element to remove |
Definition at line 1347 of file internal.h.
Referenced by MHD_cleanup_connections(), and MHD_suspend_connection().
#define EXTRA_CHECK | ( | a | ) |
Definition at line 1235 of file internal.h.
Referenced by build_header_response(), MHD_connection_handle_idle(), MHD_connection_handle_write(), MHD_connection_update_event_loop_info(), parse_connection_headers(), process_broken_line(), transmit_error_response(), and try_ready_chunked_body().
#define EXTRA_CHECKS MHD_NO |
Should we perform additional sanity checks at runtime (on our internal invariants)? This may lead to aborts, but can be useful for debugging.
Definition at line 47 of file internal.h.
#define MAX_NONCE_LENGTH 129 |
Maximum length of a nonce in digest authentication. 32(MD5 Hex) + 8(Timestamp Hex) + 1(NULL); hence 41 should suffice, but Opera (already) takes more (see Mantis #1633), so we've increased the value to support something longer...
Definition at line 164 of file internal.h.
Referenced by MHD_digest_auth_check().
#define MHD_BUF_INC_SIZE 1024 |
Minimum size by which MHD tries to increment read/write buffers. We usually begin with half the available pool space for the IO-buffer, but if absolutely needed we additively grow by the number of bytes given here (up to – theoretically – the full pool space).
Definition at line 60 of file internal.h.
Referenced by MHD_start_daemon_va(), and try_grow_read_buffer().
#define MHD_MAX | ( | a, | |
b | |||
) | ((a)<(b)) ? (b) : (a) |
Definition at line 49 of file internal.h.
#define MHD_MIN | ( | a, | |
b | |||
) | ((a)<(b)) ? (a) : (b) |
Definition at line 50 of file internal.h.
Referenced by try_ready_normal_body().
#define MHD_PANIC | ( | msg | ) | mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL) |
Trigger 'panic' action based on fatal errors.
msg | error message (const char *) |
Definition at line 86 of file internal.h.
Referenced by cleanup_connection(), close_all_connections(), internal_add_connection(), MHD_accept_connection(), MHD_cleanup_connections(), MHD_ip_count_lock(), MHD_ip_count_unlock(), MHD_ip_limit_del(), MHD_quiesce_daemon(), MHD_resume_connection(), MHD_set_connection_option(), MHD_start_daemon_va(), MHD_stop_daemon(), MHD_suspend_connection(), resume_suspended_connections(), and update_last_activity().
#define XDLL_insert | ( | head, | |
tail, | |||
element | |||
) |
Insert an element at the head of a XDLL. Assumes that head, tail and element are structs with prevX and nextX fields.
head | pointer to the head of the XDLL |
tail | pointer to the tail of the XDLL |
element | element to insert |
Definition at line 1288 of file internal.h.
Referenced by internal_add_connection(), MHD_set_connection_option(), resume_suspended_connections(), and update_last_activity().
#define XDLL_remove | ( | head, | |
tail, | |||
element | |||
) |
Remove an element from a XDLL. Assumes that head, tail and element are structs with prevX and nextX fields.
head | pointer to the head of the XDLL |
tail | pointer to the tail of the XDLL |
element | element to remove |
Definition at line 1307 of file internal.h.
Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_set_connection_option(), MHD_suspend_connection(), and update_last_activity().
typedef void*(* LogCallback)(void *cls, const char *uri, struct MHD_Connection *con) |
Signature of function called to log URI accesses.
cls | closure |
uri | uri being accessed |
con | connection handle |
Definition at line 860 of file internal.h.
typedef ssize_t(* ReceiveCallback)(struct MHD_Connection *conn, void *write_to, size_t max_bytes) |
Function to receive plaintext data.
conn | the connection struct |
write_to | where to write received data |
max_bytes | maximum number of bytes to receive |
Definition at line 487 of file internal.h.
typedef ssize_t(* TransmitCallback)(struct MHD_Connection *conn, const void *write_to, size_t max_bytes) |
Function to transmit plaintext data.
conn | the connection struct |
read_from | where to read data to transmit |
max_bytes | maximum number of bytes to transmit |
Definition at line 499 of file internal.h.
typedef size_t(* UnescapeCallback)(void *cls, struct MHD_Connection *conn, char *uri) |
Signature of function called to unescape URIs. See also MHD_http_unescape.
cls | closure |
conn | connection handle |
uri | 0-terminated string to unescape (should be updated) |
Definition at line 873 of file internal.h.
enum MHD_CONNECTION_STATE |
States in a state machine for a connection.
Transitions are any-state to CLOSED, any state to state+1, FOOTERS_SENT to INIT. CLOSED is the terminal state and INIT the initial state.
Note that transitions for reading happen only after the input has been processed; transitions for writing happen after the respective data has been put into the write buffer (the write does not have to be completed yet). A transition to CLOSED or INIT requires the write to be complete.
Definition at line 341 of file internal.h.
What is this connection waiting for?
Definition at line 134 of file internal.h.
enum MHD_EpollState |
State of the socket with respect to epoll (bitmask).
Definition at line 93 of file internal.h.
size_t MHD_http_unescape | ( | void * | cls, |
struct MHD_Connection * | connection, | ||
char * | val | ||
) |
Process escape sequences ('+'=space, HH) Updates val in place; the result should be UTF-8 encoded and cannot be larger than the input. The result must also still be 0-terminated.
cls | closure (use NULL) |
connection | handle to connection, not used |
val | value to unescape (modified in the process) |
Definition at line 119 of file internal.c.
Referenced by MHD_start_daemon_va(), and post_process_urlencoded().
time_t MHD_monotonic_time | ( | void | ) |
Equivalent to time(NULL) but tries to use some sort of monotonic clock that isn't affected by someone setting the system real time clock.
Definition at line 169 of file internal.c.
References NULL.
Referenced by internal_add_connection(), MHD_connection_handle_idle(), MHD_digest_auth_check(), MHD_get_timeout(), MHD_handle_connection(), MHD_queue_auth_fail_response(), MHD_tls_connection_handle_idle(), run_tls_handshake(), and update_last_activity().
MHD_PanicCallback mhd_panic |
Handler for fatal errors.
Definition at line 124 of file daemon.c.
Referenced by build_header_response(), MHD_create_post_processor(), MHD_init(), MHD_set_panic_func(), post_process_multipart(), post_process_urlencoded(), and process_request_body().
void* mhd_panic_cls |
Closure argument for "mhd_panic".
Definition at line 129 of file daemon.c.
Referenced by build_header_response(), MHD_create_post_processor(), MHD_init(), MHD_set_panic_func(), post_process_multipart(), post_process_urlencoded(), and process_request_body().