43 #define HTTP_100_CONTINUE "HTTP/1.1 100 Continue\r\n\r\n" 53 #define REQUEST_TOO_BIG "<html><head><title>Request too big</title></head><body>Your HTTP header was too big for the memory constraints of this webserver.</body></html>" 55 #define REQUEST_TOO_BIG "" 66 #define REQUEST_LACKS_HOST "<html><head><title>"Host:" header required</title></head><body>In HTTP 1.1, requests must include a "Host:" header, and your HTTP 1.1 request lacked such a header.</body></html>" 68 #define REQUEST_LACKS_HOST "" 79 #define REQUEST_MALFORMED "<html><head><title>Request malformed</title></head><body>Your HTTP request was syntactically incorrect.</body></html>" 81 #define REQUEST_MALFORMED "" 91 #define INTERNAL_ERROR "<html><head><title>Internal server error</title></head><body>Some programmer needs to study the manual more carefully.</body></html>" 93 #define INTERNAL_ERROR "" 100 #define DEBUG_CLOSE MHD_NO 105 #define DEBUG_SEND_DATA MHD_NO 130 #if defined(TCP_CORK) || defined(TCP_PUSH) 149 #if defined(TCP_CORK) || defined(TCP_NOPUSH) 151 #if defined(TCP_NODELAY) 156 #if defined(TCP_NOPUSH) && !defined(TCP_CORK) 158 res = (0 == setsockopt (connection->
socket_fd,
161 (
const void *) &on_val,
164 #if defined(TCP_NODELAY) 167 res &= (0 == setsockopt (connection->
socket_fd,
170 (
const void *) &off_val,
175 #if defined(TCP_NODELAY) 179 (void) setsockopt (connection->
socket_fd,
182 (
const void *) &off_val,
186 res = (0 == setsockopt (connection->
socket_fd,
189 (
const void *) &on_val,
207 #if defined(TCP_NODELAY) 210 #if defined(TCP_CORK) || defined(TCP_NOPUSH) 214 if (
NULL == connection)
216 #if defined(TCP_CORK) 218 res &= (0 == setsockopt (connection->
socket_fd,
221 (
const void *) &off_val,
225 #if defined(TCP_NODELAY) 227 res &= (0 == setsockopt (connection->
socket_fd,
230 (
const void *) &on_val,
234 #if defined(TCP_NOPUSH) && !defined(TCP_CORK) 236 res &= (0 == setsockopt (connection->
socket_fd,
239 (
const void *) &off_val,
261 #if defined(TCP_NOPUSH) && !defined(TCP_CORK) 265 if (
NULL == connection)
268 #if defined(TCP_NOPUSH) && !defined(TCP_CORK) 290 #if defined(TCP_NODELAY) 293 #if defined(TCP_CORK) 295 socklen_t param_size =
sizeof (cork_val);
299 #if defined(TCP_CORK) 303 if ( (0 != getsockopt (connection->
socket_fd,
309 res &= (0 == setsockopt (connection->
socket_fd,
312 (
const void *) &off_val,
315 #elif defined(TCP_NOPUSH) 319 res &= (0 == setsockopt (connection->
socket_fd,
322 (
const void *) &off_val,
327 res &= (0 == setsockopt (connection->
socket_fd,
330 (
const void *) &off_val,
360 if (
NULL == connection)
364 if (0 != (pos->
kind & kind))
367 if ( (
NULL != iterator) &&
368 (
MHD_YES != iterator (iterator_cls,
416 pos->
header = (
char *) key;
417 pos->
value = (
char *) value;
452 if (
NULL == connection)
455 if ((0 != (pos->
kind & kind)) &&
505 daemon = connection->
daemon;
523 (MHD_ITC_IS_VALID_ (daemon->
itc)) &&
524 (! MHD_itc_activate_ (daemon->
itc,
"c")) )
528 _(
"Failed to signal end of connection via inter-thread communication channel"));
547 MHD_DLOG (connection->
daemon,
560 #define CONNECTION_CLOSE_ERROR(c, emsg) connection_close_error (c, emsg) 562 #define CONNECTION_CLOSE_ERROR(c, emsg) connection_close_error (c, NULL) 616 if ( ((ssize_t)MHD_CONTENT_READER_END_OF_STREAM) == ret)
621 _(
"Closing connection (application reported error generating data)\n"));
659 2 * (0xFFFFFF +
sizeof(cbuf) + 2));
667 _(
"Closing connection (out of memory)\n"));
688 const size_t data_write_offset
691 ret = response->
data_size - data_write_offset;
695 &response->
data[data_write_offset],
711 _(
"Closing connection (application error generating response)\n"));
732 cblen = MHD_snprintf_(cbuf,
738 memcpy (&connection->
write_buffer[sizeof (cbuf) - cblen],
816 static const char *
const days[] = {
817 "Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat" 819 static const char *
const mons[] = {
820 "Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
821 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" 825 #if !defined(HAVE_C11_GMTIME_S) && !defined(HAVE_W32_GMTIME_S) && !defined(HAVE_GMTIME_R) 831 #if defined(HAVE_C11_GMTIME_S) 832 if (
NULL == gmtime_s (&t,
835 #elif defined(HAVE_W32_GMTIME_S) 836 if (0 != gmtime_s (&now,
839 #elif defined(HAVE_GMTIME_R) 840 if (
NULL == gmtime_r(&t,
850 "Date: %3s, %02u %3s %04u %02u:%02u:%02u GMT\r\n",
851 days[now.tm_wday % 7],
852 (
unsigned int) now.tm_mday,
853 mons[now.tm_mon % 12],
854 (
unsigned int) (1900 + now.tm_year),
855 (
unsigned int) now.tm_hour,
856 (
unsigned int) now.tm_min,
857 (
unsigned int) now.tm_sec);
911 char content_length_buf[128];
912 size_t content_length_len;
915 const char *reason_phrase;
917 const char *client_requested_close;
918 const char *response_has_close;
919 const char *response_has_keepalive;
920 const char *have_encoding;
921 const char *have_content_length;
923 int must_add_chunked_encoding;
924 int must_add_keep_alive;
925 int must_add_content_length;
928 if (0 == connection->
version[0])
963 size += strlen (date);
976 must_add_chunked_encoding =
MHD_NO;
977 must_add_keep_alive =
MHD_NO;
978 must_add_content_length =
MHD_NO;
979 response_has_keepalive =
NULL;
980 switch (connection->
state)
985 response_has_keepalive = response_has_close;
986 if ( (
NULL != response_has_close) &&
989 response_has_close =
NULL;
990 if ( (
NULL != response_has_keepalive) &&
993 response_has_keepalive =
NULL;
997 if ( (
NULL != client_requested_close) &&
1000 client_requested_close =
NULL;
1006 (
NULL == response_has_close) &&
1007 (
NULL == client_requested_close) )
1020 if (
NULL == have_encoding)
1022 must_add_chunked_encoding =
MHD_YES;
1040 if (
NULL == response_has_close)
1046 if ( ( (
NULL != client_requested_close) ||
1048 (
NULL == response_has_close) &&
1063 (
NULL == have_content_length) &&
1084 = sprintf (content_length_buf,
1087 must_add_content_length =
MHD_YES;
1091 if ( (
NULL == response_has_keepalive) &&
1092 (
NULL == response_has_close) &&
1093 (
MHD_NO == must_add_close) &&
1096 must_add_keep_alive =
MHD_YES;
1099 response_has_keepalive =
NULL;
1106 size += strlen (
"Connection: close\r\n");
1107 if (must_add_keep_alive)
1108 size += strlen (
"Connection: Keep-Alive\r\n");
1109 if (must_add_chunked_encoding)
1110 size += strlen (
"Transfer-Encoding: chunked\r\n");
1111 if (must_add_content_length)
1112 size += content_length_len;
1113 EXTRA_CHECK (! (must_add_close && must_add_keep_alive) );
1114 EXTRA_CHECK (! (must_add_chunked_encoding && must_add_content_length) );
1117 if ( (pos->
kind == kind) &&
1118 (! ( (
MHD_YES == must_add_close) &&
1119 (pos->
value == response_has_keepalive) &&
1122 size += strlen (pos->
header) + strlen (pos->
value) + 4;
1129 #ifdef HAVE_MESSAGES 1130 MHD_DLOG (connection->
daemon,
1131 "Not enough memory for write!\n");
1145 "Connection: close\r\n",
1146 strlen (
"Connection: close\r\n"));
1147 off += strlen (
"Connection: close\r\n");
1149 if (must_add_keep_alive)
1153 "Connection: Keep-Alive\r\n",
1154 strlen (
"Connection: Keep-Alive\r\n"));
1155 off += strlen (
"Connection: Keep-Alive\r\n");
1157 if (must_add_chunked_encoding)
1161 "Transfer-Encoding: chunked\r\n",
1162 strlen (
"Transfer-Encoding: chunked\r\n"));
1163 off += strlen (
"Transfer-Encoding: chunked\r\n");
1165 if (must_add_content_length)
1170 content_length_len);
1171 off += content_length_len;
1174 if ( (pos->
kind == kind) &&
1175 (! ( (pos->
value == response_has_keepalive) &&
1176 (
MHD_YES == must_add_close) &&
1179 off += sprintf (&data[off],
1187 off += strlen (date);
1218 unsigned int status_code,
1219 const char *message)
1231 #ifdef HAVE_MESSAGES 1232 MHD_DLOG (connection->
daemon,
1233 _(
"Error processing request (HTTP response code is %u (`%s')). Closing connection.\n"),
1250 _(
"Closing connection (failed to create response header)\n"));
1273 MHD_DLOG (connection->
daemon,
1274 _(
"In function %s handling connection at state: %s\n"),
1276 MHD_state_to_string (connection->
state));
1278 switch (connection->
state)
1282 if (0 == gnutls_record_get_direction (connection->tls_session))
1428 while ( (pos < connection->read_buffer_offset - 1) &&
1429 (
'\r' != rbuf[pos]) &&
1430 (
'\n' != rbuf[pos]) )
1433 (
'\n' != rbuf[pos]) )
1454 if ( (
'\r' == rbuf[pos]) &&
1455 (
'\n' == rbuf[pos + 1]) )
1488 #ifdef HAVE_MESSAGES 1489 MHD_DLOG (connection->
daemon,
1490 _(
"Not enough memory in pool to allocate header record!\n"));
1530 #ifdef HAVE_MESSAGES 1531 MHD_DLOG (connection->
daemon,
1532 _(
"Not enough memory in pool to parse cookies!\n"));
1549 while ( ((*sce) !=
'\0') &&
1556 while ( (*ekill ==
' ') &&
1578 while ( (
'\0' != semicolon[0]) &&
1580 ( (
';' != semicolon[0]) &&
1581 (
',' != semicolon[0]) ) ) )
1583 if (
'"' == semicolon[0])
1584 quotes = (quotes + 1) & 1;
1587 if (
'\0' == semicolon[0])
1589 if (
NULL != semicolon)
1591 semicolon[0] =
'\0';
1595 if ( (
'"' == equals[0]) &&
1596 (
'"' == equals[strlen (equals) - 1]) )
1598 equals[strlen (equals) - 1] =
'\0';
1631 unsigned int unused_num_headers;
1633 if (
NULL == (uri = memchr (line,
1638 connection->
method = line;
1642 while ( (
' ' == uri[0]) &&
1643 ( (
size_t)(uri - line) < line_len) )
1645 if (uri - line == line_len)
1656 http_version = line + line_len - 1;
1658 while ( (
' ' == http_version[0]) &&
1659 (http_version > uri) )
1662 while ( (
' ' != http_version[0]) &&
1663 (http_version > uri) )
1665 if (http_version > uri)
1667 http_version[0] =
'\0';
1668 connection->
version = http_version + 1;
1671 http_version - uri);
1678 line_len - (uri - line));
1698 &unused_num_headers);
1704 connection->
url = curi;
1737 _(
"Application reported internal error, closing connection.\n"));
1779 if ( (
'\r' == buffer_head[i]) ||
1780 (
'\n' == buffer_head[i]) )
1782 if ( (
'\r' == buffer_head[i]) ||
1783 (
'\n' == buffer_head[i]) )
1789 _(
"Received malformed HTTP request (bad chunked encoding). Closing connection.\n"));
1805 if (processed > available)
1806 processed = available;
1807 if (available > processed)
1814 while (i < available)
1816 if ( (
'\r' == buffer_head[i]) ||
1817 (
'\n' == buffer_head[i]) )
1827 if ( (i + 1 >= available) &&
1830 (
'0' == buffer_head[0]) ) )
1832 malformed = (i >= 6);
1838 malformed = (i != num_dig);
1844 _(
"Received malformed HTTP request (bad chunked encoding). Closing connection.\n"));
1848 if ( (i < available) &&
1849 ( (
'\r' == buffer_head[i]) ||
1850 (
'\n' == buffer_head[i]) ) )
1882 processed = available;
1899 _(
"Application reported internal error, closing connection.\n"));
1902 if (processed > used)
1906 #ifdef HAVE_MESSAGES
1907 ,
_(
"libmicrohttpd API violation")
1915 #ifdef HAVE_MESSAGES 1922 MHD_DLOG (connection->
daemon,
1923 _(
"WARNING: incomplete POST processing and connection not suspended will result in hung connection.\n"));
1930 buffer_head += used;
1935 while (
MHD_YES == instant_retry);
1960 bytes_read = connection->
recv_cls (connection,
1981 if (0 == bytes_read)
2010 ret = connection->
send_cls (connection,
2027 _(
"Sent response: `%.*s'\n"),
2056 connection->
state = next_state;
2083 colon = strchr (line,
':');
2088 _(
"Received malformed line (no colon). Closing connection.\n"));
2094 while ( (
'\0' != colon[0]) &&
2095 ( (
' ' == colon[0]) ||
2096 (
'\t' == colon[0]) ) )
2103 connection->
last = line;
2104 connection->
colon = colon;
2129 last = connection->
last;
2130 if ( (
' ' == line[0]) ||
2135 last_len = strlen (last);
2138 while ( (
' ' == tmp[0]) ||
2141 tmp_len = strlen (tmp);
2154 last_len + tmp_len + 1);
2162 memcpy (&last[last_len], tmp, tmp_len + 1);
2163 connection->
last = last;
2222 #ifdef HAVE_MESSAGES 2223 MHD_DLOG (connection->
daemon,
2224 _(
"Received HTTP 1.1 request without `Host' header.\n"));
2258 if ( (clen == end) ||
2262 #ifdef HAVE_MESSAGES 2263 MHD_DLOG (connection->
daemon,
2264 "Failed to parse `Content-Length' header. Closing connection.\n");
2328 MHD_DLOG (connection->
daemon,
2329 _(
"In function %s handling connection at state: %s\n"),
2331 MHD_state_to_string (connection->
state));
2333 switch (connection->
state)
2389 MHD_DLOG (connection->
daemon,
2390 _(
"In function %s handling connection at state: %s\n"),
2392 MHD_state_to_string (connection->
state));
2394 switch (connection->
state)
2405 ret = connection->
send_cls (connection,
2417 #ifdef HAVE_MESSAGES 2418 MHD_DLOG (connection->
daemon,
2419 _(
"Failed to send data: %s\n"),
2428 _(
"Sent 100 continue response: `%.*s'\n"),
2456 uint64_t data_write_offset;
2467 if (data_write_offset > (uint64_t)
SIZE_MAX)
2469 ret = connection->
send_cls (connection,
2471 [(
size_t)data_write_offset],
2473 (
size_t)data_write_offset);
2478 _(
"Sent %d-byte DATA response: `%.*s'\n"),
2491 #ifdef HAVE_MESSAGES 2492 MHD_DLOG (connection->
daemon,
2493 _(
"Failed to send data: %s\n"),
2544 _(
"Internal error\n"));
2615 unsigned int timeout;
2626 _(
"In function %s handling connection at state: %s\n"),
2628 MHD_state_to_string (connection->
state));
2630 switch (connection->
state)
2639 if ( (
NULL == line) ||
2859 _(
"Closing connection (failed to create response header)\n"));
2962 _(
"Closing connection (failed to create response header)\n"));
2984 client_close = ( (
NULL != end) &&
3068 if ( (0 != timeout) &&
3077 #ifdef EPOLL_SUPPORT 3088 daemon->eready_tail,
3099 daemon->eready_tail,
3111 daemon->eready_tail,
3121 return MHD_connection_epoll_update_ (connection);
3128 #ifdef EPOLL_SUPPORT 3152 struct epoll_event event;
3154 event.events = EPOLLIN | EPOLLOUT | EPOLLET;
3155 event.data.ptr = connection;
3156 if (0 != epoll_ctl (daemon->epoll_fd,
3161 #ifdef HAVE_MESSAGES 3164 _(
"Call to epoll_ctl failed: %s\n"),
3212 if (
NULL == connection->tls_session)
3214 connection->cipher = gnutls_cipher_get (connection->tls_session);
3217 if (
NULL == connection->tls_session)
3219 connection->protocol = gnutls_protocol_get_version (connection->tls_session);
3222 if (
NULL == connection->tls_session)
3259 daemon = connection->
daemon;
3275 va_start (ap, option);
3311 unsigned int status_code,
3316 if ( (
NULL == connection) ||
3317 (
NULL == response) ||
3322 daemon = connection->
daemon;
3326 #ifdef HAVE_MESSAGES 3328 _(
"Application used invalid status code for 'upgrade' response!\n"));
3336 #ifdef HAVE_MESSAGES 3338 _(
"Application attempted 'upgrade' without setting MHD_USE_SUSPEND_RESUME!\n"));
3347 #ifdef HAVE_MESSAGES 3349 _(
"Application attempted 'upgrade' HTTPS connection in epoll mode without setting MHD_USE_HTTPS_EPOLL_UPGRADE!\n"));
static int process_header_line(struct MHD_Connection *connection, char *line)
#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE
int(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
static int parse_cookie_header(struct MHD_Connection *connection)
void * unescape_callback_cls
#define MHD_send_(s, b, l)
static int try_ready_normal_body(struct MHD_Connection *connection)
#define DLL_insert(head, tail, element)
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
#define MHD_HTTP_METHOD_CONNECT
static void MHD_connection_update_event_loop_info(struct MHD_Connection *connection)
enum MHD_CONNECTION_STATE state
static int try_ready_chunked_body(struct MHD_Connection *connection)
void * MHD_pool_reset(struct MemoryPool *pool, void *keep, size_t copy_bytes, size_t new_size)
uint64_t response_write_position
void MHD_pool_destroy(struct MemoryPool *pool)
#define HTTP_100_CONTINUE
enum MHD_ConnectionEventLoopInfo event_loop_info
size_t current_chunk_size
int MHD_connection_handle_write(struct MHD_Connection *connection)
static int connection_add_header(struct MHD_Connection *connection, const char *key, const char *value, enum MHD_ValueKind kind)
Methods for managing connections.
void MHD_connection_close_(struct MHD_Connection *connection, enum MHD_RequestTerminationCode termination_code)
struct MHD_Response * response
#define REQUEST_LACKS_HOST
#define MHD_socket_get_error_()
struct MHD_Connection * normal_timeout_tail
Header for platform missing functions.
#define MHD_HTTP_NOT_MODIFIED
MHD_RequestTerminationCode
static int do_read(struct MHD_Connection *connection)
struct MHD_HTTP_Header * first_header
static void transmit_error_response(struct MHD_Connection *connection, unsigned int status_code, const char *message)
MHD_AccessHandlerCallback default_handler
void * MHD_pool_allocate(struct MemoryPool *pool, size_t size, int from_end)
size_t current_chunk_offset
static void call_connection_handler(struct MHD_Connection *connection)
#define EDLL_insert(head, tail, element)
uint64_t remaining_upload_size
unsigned int responseCode
int MHD_parse_arguments_(struct MHD_Connection *connection, enum MHD_ValueKind kind, char *args, MHD_ArgumentIterator_ cb, unsigned int *num_headers)
Methods for managing response objects.
static void cleanup_connection(struct MHD_Connection *connection)
#define MHD_UNSIGNED_LONG_LONG
void * uri_log_callback_cls
struct MHD_Daemon * daemon
int(* idle_handler)(struct MHD_Connection *connection)
struct MHD_Connection * manual_timeout_head
struct MHD_Connection * cleanup_head
#define MHD_SCKT_ERR_IS_REMOTE_DISCNN_(err)
static void connection_close_error(struct MHD_Connection *connection, const char *emsg)
#define XDLL_remove(head, tail, element)
size_t MHD_strx_to_sizet_n_(const char *str, size_t maxlen, size_t *out_val)
#define MHD_mutex_unlock_chk_(pmutex)
#define XDLL_insert(head, tail, element)
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
static int keepalive_possible(struct MHD_Connection *connection)
struct MHD_Connection * cleanup_tail
Header for platform-independent inter-thread communication.
int MHD_connection_handle_read(struct MHD_Connection *connection)
size_t write_buffer_send_offset
void * MHD_pool_reallocate(struct MemoryPool *pool, void *old, size_t old_size, size_t new_size)
static void get_date_string(char *date)
struct MHD_Connection * manual_timeout_tail
size_t continue_message_write_offset
MHD_UpgradeHandler upgrade_handler
#define REQUEST_MALFORMED
#define MHD_INVALID_SOCKET
#define MHD_SCKT_ERR_IS_EAGAIN_(err)
#define MHD_HTTP_NO_CONTENT
LogCallback uri_log_callback
static int socket_start_no_buffering(struct MHD_Connection *connection)
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
void MHD_increment_response_rc(struct MHD_Response *response)
#define MHD_CONTENT_READER_END_OF_STREAM
int(* read_handler)(struct MHD_Connection *connection)
struct MHD_Connection * normal_timeout_head
static void update_last_activity(struct MHD_Connection *connection)
static int need_100_continue(struct MHD_Connection *connection)
#define MHD_HTTP_VERSION_1_1
internal shared structures
UnescapeCallback unescape_callback
#define MHD_socket_last_strerr_()
static int try_grow_read_buffer(struct MHD_Connection *connection)
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
internal monotonic clock functions implementations
int(* write_handler)(struct MHD_Connection *connection)
#define MHD_HTTP_BAD_REQUEST
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
struct MHD_Connection * connections_head
static int check_write_done(struct MHD_Connection *connection, enum MHD_CONNECTION_STATE next_state)
int MHD_connection_handle_idle(struct MHD_Connection *connection)
#define MHD_socket_strerr_(err)
unsigned int connection_timeout
static int process_broken_line(struct MHD_Connection *connection, char *line, enum MHD_ValueKind kind)
enum MHD_ResponseFlags flags
#define MHD_HTTP_METHOD_HEAD
static void parse_connection_headers(struct MHD_Connection *connection)
time_t MHD_monotonic_sec_counter(void)
Header for string manipulating helpers.
size_t write_buffer_append_offset
MHD_RequestCompletedCallback notify_completed
static int socket_start_extra_buffering(struct MHD_Connection *connection)
void MHD_set_http_callbacks_(struct MHD_Connection *connection)
#define MHD_HTTP_METHOD_PUT
int MHD_str_equal_caseless_(const char *str1, const char *str2)
#define DLL_remove(head, tail, element)
void * notify_completed_cls
static void process_request_body(struct MHD_Connection *connection)
#define MHD_HTTP_VERSION_1_0
TransmitCallback send_cls
_MHD_EXTERN int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
#define MHD_HTTP_INTERNAL_SERVER_ERROR
#define MHD_CONTENT_READER_END_WITH_ERROR
MHD_ContentReaderCallback crc
static int parse_initial_message_line(struct MHD_Connection *connection, char *line, size_t line_len)
MHD_PanicCallback mhd_panic
struct MHD_Connection * suspended_connections_tail
static int socket_start_normal_buffering(struct MHD_Connection *connection)
#define MHD_UNSIGNED_LONG_LONG_PRINTF
static int socket_flush_possible(struct MHD_Connection *connection)
static int socket_start_no_buffering_flush(struct MHD_Connection *connection)
int MHD_response_execute_upgrade_(struct MHD_Response *response, struct MHD_Connection *connection)
static int do_write(struct MHD_Connection *connection)
size_t read_buffer_offset
static char * get_next_header_line(struct MHD_Connection *connection, size_t *line_len)
void * default_handler_cls
unsigned int connection_timeout
_MHD_EXTERN const char * MHD_get_response_header(struct MHD_Response *response, const char *key)
#define MHD_HTTP_REQUEST_URI_TOO_LONG
#define MHD_SCKT_ERR_IS_EINTR_(err)
MHD_mutex_ cleanup_connection_mutex
#define CONNECTION_CLOSE_ERROR(c, emsg)
Header for platform-independent locks abstraction.
struct MHD_HTTP_Header * headers_received
#define MHD_HTTP_SWITCHING_PROTOCOLS
struct MHD_Connection * connections_tail
_MHD_EXTERN const char * MHD_get_reason_phrase_for(unsigned int code)
_MHD_EXTERN int MHD_set_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value)
struct MHD_HTTP_Header * headers_received_tail
static int build_header_response(struct MHD_Connection *connection)
#define MHD_mutex_lock_chk_(pmutex)
#define MHD_HTTP_METHOD_POST
size_t MHD_str_to_uint64_(const char *str, uint64_t *out_val)
struct MHD_Connection * suspended_connections_head
memory pool; mostly used for efficient (de)allocation for each connection and bounding memory use for...