GNU libmicrohttpd  0.9.71
internal.h
Go to the documentation of this file.
1 /*
2  This file is part of libmicrohttpd
3  Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
27 #ifndef INTERNAL_H
28 #define INTERNAL_H
29 
30 #include "mhd_options.h"
31 #include "platform.h"
32 #include "microhttpd.h"
33 #include "mhd_assert.h"
34 
35 #ifdef HTTPS_SUPPORT
36 #include <gnutls/gnutls.h>
37 #if GNUTLS_VERSION_MAJOR >= 3
38 #include <gnutls/abstract.h>
39 #endif
40 #endif /* HTTPS_SUPPORT */
41 
42 #ifdef HAVE_STDBOOL_H
43 #include <stdbool.h>
44 #endif
45 
46 
47 #ifdef MHD_PANIC
48 /* Override any defined MHD_PANIC macro with proper one */
49 #undef MHD_PANIC
50 #endif /* MHD_PANIC */
51 
52 #ifdef HAVE_MESSAGES
53 
58 #define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg); \
59  BUILTIN_NOT_REACHED; } while (0)
60 #else
61 
66 #define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL); \
67  BUILTIN_NOT_REACHED; } while (0)
68 #endif
69 
70 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
71 #include "mhd_threads.h"
72 #include "mhd_locks.h"
73 #endif
74 #include "mhd_sockets.h"
75 #include "mhd_itc_types.h"
76 
77 
82 #define MHD_fd_close_chk_(fd) do { \
83  if ( (0 != close ((fd)) && (EBADF == errno)) ) \
84  MHD_PANIC (_ ("Failed to close FD.\n")); \
85 } while (0)
86 
91 #define EXTRA_CHECKS MHD_NO
92 
93 #define MHD_MAX(a,b) (((a)<(b)) ? (b) : (a))
94 #define MHD_MIN(a,b) (((a)<(b)) ? (a) : (b))
95 
96 
104 #define MHD_BUF_INC_SIZE 1024
105 
106 
111 
115 extern void *mhd_panic_cls;
116 
117 /* If we have Clang or gcc >= 4.5, use __buildin_unreachable() */
118 #if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= \
119  5)
120 #define BUILTIN_NOT_REACHED __builtin_unreachable ()
121 #elif defined(_MSC_FULL_VER)
122 #define BUILTIN_NOT_REACHED __assume (0)
123 #else
124 #define BUILTIN_NOT_REACHED
125 #endif
126 
127 #ifndef MHD_STATICSTR_LEN_
128 
131 #define MHD_STATICSTR_LEN_(macro) (sizeof(macro) / sizeof(char) - 1)
132 #endif /* ! MHD_STATICSTR_LEN_ */
133 
134 
139 {
140 
146 
152 
158 
163 
168 
173 
178 };
179 
180 
185 {
190 
195 
200 
205 };
206 
207 
212 #define MHD_TEST_ALLOW_SUSPEND_RESUME 8192
213 
220 #define MAX_NONCE_LENGTH 129
221 
222 
228 {
229 
234  uint64_t nc;
235 
240  uint64_t nmask;
241 
246 
247 };
248 
249 #ifdef HAVE_MESSAGES
250 
254 void
255 MHD_DLOG (const struct MHD_Daemon *daemon,
256  const char *format,
257  ...);
258 
259 #endif
260 
261 
265 struct MHD_HTTP_Header
266 {
270  struct MHD_HTTP_Header *next;
271 
275  char *header;
276 
280  size_t header_size;
281 
285  char *value;
286 
290  size_t value_size;
291 
296  enum MHD_ValueKind kind;
297 
298 };
299 
300 
304 struct MHD_Response
305 {
306 
313 
318  char *data;
319 
324  void *crc_cls;
325 
331 
337 
338 #ifdef UPGRADE_SUPPORT
339 
344  MHD_UpgradeHandler upgrade_handler;
345 
349  void *upgrade_handler_cls;
350 #endif /* UPGRADE_SUPPORT */
351 
352 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
353 
357  MHD_mutex_ mutex;
358 #endif
359 
363  uint64_t total_size;
364 
369  uint64_t data_start;
370 
374  uint64_t fd_off;
375 
380  size_t data_size;
381 
385  size_t data_buffer_size;
386 
391  unsigned int reference_count;
392 
396  int fd;
397 
402 
403 };
404 
405 
422 {
428 
433 
438 
443 
448 
453 
458 
463 
469 
475 
481 
486 
491 
497 
502 
507 
512 
517 
522 
527 
528 #ifdef UPGRADE_SUPPORT
529 
533  MHD_CONNECTION_UPGRADE
534 #endif /* UPGRADE_SUPPORT */
535 
536 };
537 
538 
543 {
554 };
555 
559 #define DEBUG_STATES MHD_NO
560 
561 
562 #ifdef HAVE_MESSAGES
563 #if DEBUG_STATES
564 const char *
565 MHD_state_to_string (enum MHD_CONNECTION_STATE state);
566 
567 #endif
568 #endif
569 
578 typedef ssize_t
580  void *write_to,
581  size_t max_bytes);
582 
583 
592 typedef ssize_t
594  const void *read_from,
595  size_t max_bytes);
596 
597 
602 {
607 
612 
617 };
618 
619 
623 struct MHD_Connection
624 {
625 
626 #ifdef EPOLL_SUPPORT
627 
630  struct MHD_Connection *nextE;
631 
635  struct MHD_Connection *prevE;
636 #endif
637 
641  struct MHD_Connection *next;
642 
646  struct MHD_Connection *prev;
647 
655  struct MHD_Connection *nextX;
656 
660  struct MHD_Connection *prevX;
661 
665  struct MHD_Daemon *daemon;
666 
671 
676 
681 
690  struct MemoryPool *pool;
691 
699 
707  void *socket_context;
708 
712  char *method;
713 
718  const char *url;
719 
724  char *version;
725 
732 
738  char *read_buffer;
739 
745 
752  char *last;
753 
761  char *colon;
762 
767  struct sockaddr *addr;
768 
769 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
770 
774  MHD_thread_handle_ID_ pid;
775 #endif
776 
784 
790 
795 
800 
806 
811  size_t header_size;
812 
818 
825 
826 #if defined(_MHD_HAVE_SENDFILE)
827  enum MHD_resp_sender_
828  {
829  MHD_resp_sender_std = 0,
830  MHD_resp_sender_sendfile
831  } resp_sender;
832 #endif /* _MHD_HAVE_SENDFILE */
833 
839 
843  socklen_t addr_len;
844 
849  time_t last_activity;
850 
855  time_t connection_timeout;
856 
861 
868 
875 
879  bool sk_nonblck;
880 
886 
893  bool read_closed;
894 
895 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
896 
899  bool thread_joined;
900 #endif
901 
906  bool in_idle;
907 
913 
914 #ifdef EPOLL_SUPPORT
915 
918  enum MHD_EpollState epoll_state;
919 #endif
920 
925 
930 
935  unsigned int responseCode;
936 
945 
953 
959 
964 
965 #ifdef UPGRADE_SUPPORT
966 
972  struct MHD_UpgradeResponseHandle *urh;
973 #endif /* UPGRADE_SUPPORT */
974 
975 #ifdef HTTPS_SUPPORT
976 
980  gnutls_session_t tls_session;
981 
985  int protocol;
986 
990  int cipher;
991 
995  enum MHD_TLS_CONN_STATE tls_state;
996 
1001  bool tls_read_ready;
1002 #endif /* HTTPS_SUPPORT */
1003 
1007  bool suspended;
1008 
1013 
1017  bool resuming;
1018 };
1019 
1020 
1021 #ifdef UPGRADE_SUPPORT
1022 
1031 #define RESERVE_EBUF_SIZE 8
1032 
1039 struct UpgradeEpollHandle
1040 {
1045  struct MHD_UpgradeResponseHandle *urh;
1046 
1062  MHD_socket socket;
1063 
1067  enum MHD_EpollState celi;
1068 
1069 };
1070 
1071 
1077 struct MHD_UpgradeResponseHandle
1078 {
1084  struct MHD_Connection *connection;
1085 
1086 #ifdef HTTPS_SUPPORT
1087 
1090  struct MHD_UpgradeResponseHandle *next;
1091 
1095  struct MHD_UpgradeResponseHandle *prev;
1096 
1097 #ifdef EPOLL_SUPPORT
1098 
1101  struct MHD_UpgradeResponseHandle *nextE;
1102 
1106  struct MHD_UpgradeResponseHandle *prevE;
1107 
1111  bool in_eready_list;
1112 #endif
1113 
1119  char *in_buffer;
1120 
1126  char *out_buffer;
1127 
1133  size_t in_buffer_size;
1134 
1140  size_t out_buffer_size;
1141 
1149  size_t in_buffer_used;
1150 
1158  size_t out_buffer_used;
1159 
1163  struct UpgradeEpollHandle app;
1164 
1169  struct UpgradeEpollHandle mhd;
1170 
1175  char e_buf[RESERVE_EBUF_SIZE];
1176 
1177 #endif /* HTTPS_SUPPORT */
1178 
1189  volatile bool was_closed;
1190 
1212  bool clean_ready;
1213 };
1214 #endif /* UPGRADE_SUPPORT */
1215 
1216 
1225 typedef void *
1226 (*LogCallback)(void *cls,
1227  const char *uri,
1228  struct MHD_Connection *con);
1229 
1239 typedef size_t
1240 (*UnescapeCallback)(void *cls,
1241  struct MHD_Connection *conn,
1242  char *uri);
1243 
1244 
1252 struct MHD_Daemon
1253 {
1254 
1259 
1264 
1269 
1274 
1279 
1284 
1288  struct MHD_Connection *cleanup_head;
1289 
1293  struct MHD_Connection *cleanup_tail;
1294 
1295 #ifdef EPOLL_SUPPORT
1296 
1299  struct MHD_Connection *eready_head;
1300 
1304  struct MHD_Connection *eready_tail;
1305 
1306 #ifdef UPGRADE_SUPPORT
1307 
1310  struct MHD_UpgradeResponseHandle *eready_urh_head;
1311 
1315  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1316 #endif /* UPGRADE_SUPPORT */
1317 #endif /* EPOLL_SUPPORT */
1318 
1334 
1341 
1349 
1356 
1362 
1366  void *apc_cls;
1367 
1373 
1378 
1384 
1389 
1398 
1403 
1408 
1413 
1414 #ifdef HAVE_MESSAGES
1415 
1419  MHD_LogCallback custom_error_log;
1420 
1424  void *custom_error_log_cls;
1425 #endif
1426 
1430  struct MHD_Daemon *master;
1431 
1432 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1433 
1436  struct MHD_Daemon *worker_pool;
1437 #endif
1438 
1443 
1447  size_t pool_size;
1448 
1453 
1454 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1455 
1458  size_t thread_stack_size;
1459 
1463  unsigned int worker_pool_size;
1464 
1468  MHD_thread_handle_ID_ pid;
1469 
1473  MHD_mutex_ per_ip_connection_mutex;
1474 
1479  MHD_mutex_ cleanup_connection_mutex;
1480 #endif
1481 
1487 
1492 
1503 
1504 #ifdef EPOLL_SUPPORT
1505 
1508  int epoll_fd;
1509 
1514  bool listen_socket_in_epoll;
1515 
1516 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
1517 
1521  int epoll_upgrade_fd;
1522 
1527  bool upgrade_fd_in_epoll;
1528 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
1529 
1530 #endif
1531 
1536  struct MHD_itc_ itc;
1537 
1541  volatile bool shutdown;
1542 
1548  volatile bool was_quiesced;
1549 
1557  bool at_limit;
1558 
1559  /*
1560  * Do we need to process resuming connections?
1561  */
1562  bool resuming;
1563 
1573  bool data_already_pending;
1574 
1578  unsigned int connections;
1579 
1583  unsigned int connection_limit;
1584 
1590 
1596 
1601 
1605  uint16_t port;
1606 
1611 
1612 #ifdef HTTPS_SUPPORT
1613 #ifdef UPGRADE_SUPPORT
1614 
1619  struct MHD_UpgradeResponseHandle *urh_head;
1620 
1626  struct MHD_UpgradeResponseHandle *urh_tail;
1627 #endif /* UPGRADE_SUPPORT */
1628 
1632  gnutls_priority_t priority_cache;
1633 
1638  gnutls_credentials_type_t cred_type;
1639 
1643  gnutls_certificate_credentials_t x509_cred;
1644 
1648  gnutls_dh_params_t dh_params;
1649 
1653  gnutls_psk_server_credentials_t psk_cred;
1654 
1655 #if GNUTLS_VERSION_MAJOR >= 3
1656 
1660  gnutls_certificate_retrieve_function2 *cert_callback;
1661 
1665  MHD_PskServerCredentialsCallback cred_callback;
1666 
1670  void *cred_callback_cls;
1671 #endif
1672 
1673 #if GNUTLS_VERSION_NUMBER >= 0x030603
1674 
1678  gnutls_certificate_retrieve_function3 *cert_callback2;
1679 #endif
1680 
1684  const char *https_mem_key;
1685 
1689  const char *https_mem_cert;
1690 
1694  const char *https_key_password;
1695 
1699  const char *https_mem_trust;
1700 
1704  gnutls_dh_params_t https_mem_dhparams;
1705 
1709  bool have_dhparams;
1710 
1711 #endif /* HTTPS_SUPPORT */
1712 
1713 #ifdef DAUTH_SUPPORT
1714 
1718  const char *digest_auth_random;
1719 
1723  struct MHD_NonceNc *nnc;
1724 
1725 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1726 
1729  MHD_mutex_ nnc_lock;
1730 #endif
1731 
1735  size_t digest_auth_rand_size;
1736 
1740  unsigned int nonce_nc_size;
1741 
1742 #endif
1743 
1744 #ifdef TCP_FASTOPEN
1745 
1748  unsigned int fastopen_queue_size;
1749 #endif
1750 
1754  unsigned int listen_backlog_size;
1755 };
1756 
1757 
1766 #define DLL_insert(head,tail,element) do { \
1767  mhd_assert (NULL == (element)->next); \
1768  mhd_assert (NULL == (element)->prev); \
1769  (element)->next = (head); \
1770  (element)->prev = NULL; \
1771  if ((tail) == NULL) \
1772  (tail) = element; \
1773  else \
1774  (head)->prev = element; \
1775  (head) = (element); } while (0)
1776 
1777 
1787 #define DLL_remove(head,tail,element) do { \
1788  mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \
1789  mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \
1790  if ((element)->prev == NULL) \
1791  (head) = (element)->next; \
1792  else \
1793  (element)->prev->next = (element)->next; \
1794  if ((element)->next == NULL) \
1795  (tail) = (element)->prev; \
1796  else \
1797  (element)->next->prev = (element)->prev; \
1798  (element)->next = NULL; \
1799  (element)->prev = NULL; } while (0)
1800 
1801 
1810 #define XDLL_insert(head,tail,element) do { \
1811  mhd_assert (NULL == (element)->nextX); \
1812  mhd_assert (NULL == (element)->prevX); \
1813  (element)->nextX = (head); \
1814  (element)->prevX = NULL; \
1815  if (NULL == (tail)) \
1816  (tail) = element; \
1817  else \
1818  (head)->prevX = element; \
1819  (head) = (element); } while (0)
1820 
1821 
1831 #define XDLL_remove(head,tail,element) do { \
1832  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1833  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1834  if (NULL == (element)->prevX) \
1835  (head) = (element)->nextX; \
1836  else \
1837  (element)->prevX->nextX = (element)->nextX; \
1838  if (NULL == (element)->nextX) \
1839  (tail) = (element)->prevX; \
1840  else \
1841  (element)->nextX->prevX = (element)->prevX; \
1842  (element)->nextX = NULL; \
1843  (element)->prevX = NULL; } while (0)
1844 
1845 
1854 #define EDLL_insert(head,tail,element) do { \
1855  (element)->nextE = (head); \
1856  (element)->prevE = NULL; \
1857  if ((tail) == NULL) \
1858  (tail) = element; \
1859  else \
1860  (head)->prevE = element; \
1861  (head) = (element); } while (0)
1862 
1863 
1873 #define EDLL_remove(head,tail,element) do { \
1874  if ((element)->prevE == NULL) \
1875  (head) = (element)->nextE; \
1876  else \
1877  (element)->prevE->nextE = (element)->nextE; \
1878  if ((element)->nextE == NULL) \
1879  (tail) = (element)->prevE; \
1880  else \
1881  (element)->nextE->prevE = (element)->prevE; \
1882  (element)->nextE = NULL; \
1883  (element)->prevE = NULL; } while (0)
1884 
1885 
1891 void
1892 MHD_unescape_plus (char *arg);
1893 
1894 
1908 typedef enum MHD_Result
1910  const char *key,
1911  size_t key_size,
1912  const char *value,
1913  size_t value_size,
1914  enum MHD_ValueKind kind);
1915 
1916 
1931 enum MHD_Result
1932 MHD_parse_arguments_ (struct MHD_Connection *connection,
1933  enum MHD_ValueKind kind,
1934  char *args,
1936  unsigned int *num_headers);
1937 
1938 
1955 bool
1957  const char *key,
1958  size_t key_len,
1959  const char *token,
1960  size_t token_len);
1961 
1973 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1974  MHD_check_response_header_token_ci ((r),(k),MHD_STATICSTR_LEN_ (k), \
1975  (tkn),MHD_STATICSTR_LEN_ (tkn))
1976 
1977 
1987 void
1988 internal_suspend_connection_ (struct MHD_Connection *connection);
1989 
1990 #endif
bool thread_joined
Definition: internal.h:779
unsigned int per_ip_connection_limit
Definition: internal.h:1595
void * unescape_callback_cls
Definition: internal.h:1412
enum MHD_Result(* MHD_AccessHandlerCallback)(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls)
Definition: microhttpd.h:2175
uint64_t total_size
Definition: internal.h:1642
bool have_chunked_upload
Definition: internal.h:944
additional automatic macros for MHD_config.h
uint64_t fd_off
Definition: internal.h:1653
uint64_t current_chunk_offset
Definition: internal.h:958
bool data_already_pending
Definition: internal.h:1500
socklen_t addr_len
Definition: internal.h:733
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
Definition: microhttpd.h:1355
struct MHD_Connection * cleanup_head
Definition: internal.h:1177
enum MHD_CONNECTION_STATE state
Definition: internal.h:924
uint64_t response_write_position
Definition: internal.h:824
public interface to libmicrohttpd
enum MHD_ConnKeepAlive keepalive
Definition: internal.h:731
void * mhd_panic_cls
Definition: panic.c:36
ssize_t(* ReceiveCallback)(struct MHD_Connection *conn, void *write_to, size_t max_bytes)
Definition: internal.h:182
enum MHD_ConnectionEventLoopInfo event_loop_info
Definition: internal.h:929
struct MHD_Connection * prevX
Definition: internal.h:670
MHD_thread_handle_ID_ pid
Definition: internal.h:1249
time_t connection_timeout
Definition: internal.h:1589
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1606
MHD_PanicCallback mhd_panic
Definition: panic.c:31
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2340
MHD_CONNECTION_STATE
Definition: internal.h:421
char * version
Definition: internal.h:724
int suspended_dummy
Definition: internal.h:1012
struct MHD_Response * response
Definition: internal.h:680
char * data
Definition: internal.h:1588
char * colon
Definition: internal.h:761
char * write_buffer
Definition: internal.h:744
volatile bool was_quiesced
Definition: internal.h:1548
struct MHD_Connection * manual_timeout_head
Definition: internal.h:1143
size_t data_size
Definition: internal.h:1659
void *(* LogCallback)(void *cls, const char *uri, struct MHD_Connection *con)
Definition: internal.h:1226
MHD_thread_handle_ID_ pid
Definition: internal.h:723
char * value
Definition: internal.h:352
enum MHD_ValueKind kind
Definition: internal.h:358
MHD_AccessHandlerCallback default_handler
Definition: internal.h:1258
int MHD_socket
Definition: microhttpd.h:195
uint64_t remaining_upload_size
Definition: internal.h:817
unsigned int responseCode
Definition: internal.h:935
platform-specific includes for libmicrohttpd
char * header
Definition: internal.h:347
void * uri_log_callback_cls
Definition: internal.h:1402
struct MHD_Daemon * daemon
Definition: internal.h:675
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:2116
size_t header_size
Definition: internal.h:811
Types for platform-independent inter-thread communication.
void(* MHD_LogCallback)(void *cls, const char *fm, va_list ap)
Definition: microhttpd.h:1337
int listening_address_reuse
Definition: internal.h:1502
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1259
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1383
struct MHD_Connection * next
Definition: internal.h:651
bool client_aware
Definition: internal.h:867
int strict_for_client
Definition: internal.h:1610
void * socket_context
Definition: internal.h:694
struct MHD_HTTP_Header * first_header
Definition: internal.h:1582
uint64_t nmask
Definition: internal.h:240
bool MHD_check_response_header_token_ci(const struct MHD_Response *response, const char *key, size_t key_len, const char *token, size_t token_len)
Definition: response.c:323
size_t data_buffer_size
Definition: internal.h:1664
size_t write_buffer_send_offset
Definition: internal.h:799
void * crc_cls
Definition: internal.h:1594
struct MHD_Connection * connections_tail
Definition: internal.h:1160
enum MHD_Result(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2130
struct MHD_Daemon * worker_pool
Definition: internal.h:1073
MHD_DisableSanityCheck
Definition: microhttpd.h:1724
size_t read_buffer_size
Definition: internal.h:783
macros for mhd_assert()
void * client_context
Definition: internal.h:698
const char * url
Definition: internal.h:718
size_t continue_message_write_offset
Definition: internal.h:838
MHD_socket socket_fd
Definition: internal.h:752
bool MHD_parse_arguments_(struct MHD_Request *request, enum MHD_ValueKind kind, char *args, MHD_ArgumentIterator_ cb, unsigned int *num_headers)
Definition: internal.c:190
char * method
Definition: internal.h:712
unsigned int connection_limit
Definition: internal.h:1583
char nonce[MAX_NONCE_LENGTH]
Definition: internal.h:245
unsigned int worker_pool_size
Definition: internal.h:1366
enum MHD_FLAG options
Definition: internal.h:1600
struct MHD_Connection * connections_head
Definition: internal.h:1155
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2810
LogCallback uri_log_callback
Definition: internal.h:1397
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2324
bool in_cleanup
Definition: internal.h:912
unsigned int reference_count
Definition: internal.h:1675
time_t connection_timeout
Definition: internal.h:745
ssize_t(* TransmitCallback)(struct MHD_Connection *conn, const void *read_from, size_t max_bytes)
Definition: internal.h:196
#define MAX_NONCE_LENGTH
Definition: internal.h:220
struct MHD_Daemon * master
Definition: internal.h:1068
struct MHD_Connection * manual_timeout_tail
Definition: internal.h:1150
uint16_t port
Definition: internal.h:1605
char * last
Definition: internal.h:752
bool sk_cork_on
Definition: internal.h:885
unsigned int connections
Definition: internal.h:1361
struct MHD_Connection * prev
Definition: internal.h:656
MHD_ValueKind
Definition: microhttpd.h:1765
char * read_buffer
Definition: internal.h:738
MHD_EpollState
Definition: internal.h:587
ReceiveCallback recv_cls
Definition: internal.h:706
size_t value_size
Definition: internal.h:290
size_t write_buffer_size
Definition: internal.h:794
uint64_t data_start
Definition: internal.h:1648
struct MHD_Connection * normal_timeout_head
Definition: internal.h:1128
struct MHD_Connection * nextX
Definition: internal.h:665
MHD_Result
Definition: microhttpd.h:140
UnescapeCallback unescape_callback
Definition: internal.h:1407
size_t header_size
Definition: internal.h:280
unsigned int listen_backlog_size
Definition: internal.h:1754
unsigned int connection_timeout_dummy
Definition: internal.h:860
struct MHD_Connection * suspended_connections_tail
Definition: internal.h:1172
size_t pool_size
Definition: internal.h:1447
bool tls_read_ready
Definition: internal.h:769
struct MHD_itc_ itc
Definition: internal.h:1410
MHD_AcceptPolicyCallback apc
Definition: internal.h:1361
time_t last_activity
Definition: internal.h:739
struct MHD_Connection * cleanup_tail
Definition: internal.h:1182
bool sk_nonblck
Definition: internal.h:784
enum MHD_ResponseFlags flags
Definition: internal.h:401
uint64_t nc
Definition: internal.h:234
struct MHD_HTTP_Header * next
Definition: internal.h:342
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:2198
size_t write_buffer_append_offset
Definition: internal.h:805
MHD_ConnKeepAlive
Definition: internal.h:154
struct MHD_Connection * normal_timeout_tail
Definition: internal.h:1135
MHD_RequestCompletedCallback notify_completed
Definition: internal.h:1372
void(* MHD_UpgradeHandler)(void *cls, struct MHD_Connection *connection, void *con_cls, const char *extra_in, size_t extra_in_size, MHD_socket sock, struct MHD_UpgradeResponseHandle *urh)
Definition: microhttpd.h:3304
bool resuming
Definition: internal.h:1510
bool read_closed
Definition: internal.h:792
void * notify_completed_cls
Definition: internal.h:1377
MHD_socket listen_fd
Definition: internal.h:1491
struct MemoryPool * pool
Definition: internal.h:685
bool(* MHD_ArgumentIterator_)(struct MHD_Request *request, const char *key, const char *value, enum MHD_ValueKind kind)
Definition: internal.h:1707
size_t(* UnescapeCallback)(void *cls, struct MHD_Connection *conn, char *uri)
Definition: internal.h:1240
void * notify_connection_cls
Definition: internal.h:1388
void * apc_cls
Definition: internal.h:1366
MHD_ContentReaderCallback crc
Definition: internal.h:1600
bool at_limit
Definition: internal.h:1483
struct sockaddr * addr
Definition: internal.h:767
MHD_mutex_ mutex
Definition: internal.h:1637
bool suspended
Definition: internal.h:764
MHD_ConnectionEventLoopInfo
Definition: internal.h:184
struct MHD_Connection * suspended_connections_head
Definition: internal.h:1166
void * per_ip_connection_count
Definition: internal.h:1187
size_t read_buffer_offset
Definition: internal.h:789
void * default_handler_cls
Definition: internal.h:1263
volatile bool shutdown
Definition: internal.h:1526
MHD_ResponseFlags
Definition: microhttpd.h:2936
MHD_TLS_CONN_STATE
Definition: internal.h:542
MHD_mutex_ cleanup_connection_mutex
Definition: internal.h:1265
uint64_t current_chunk_size
Definition: internal.h:952
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2224
struct MHD_HTTP_Header * headers_received
Definition: internal.h:670
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1037
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:675
size_t pool_increment
Definition: internal.h:1452
void MHD_unescape_plus(char *arg)
Definition: internal.c:123
enum MHD_DisableSanityCheck insanity_level
Definition: internal.h:1486