GNU libmicrohttpd  0.9.66
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); BUILTIN_NOT_REACHED; } while (0)
59 #else
60 
65 #define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL); BUILTIN_NOT_REACHED; } while (0)
66 #endif
67 
68 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
69 #include "mhd_threads.h"
70 #include "mhd_locks.h"
71 #endif
72 #include "mhd_sockets.h"
73 #include "mhd_itc_types.h"
74 
75 
80 #define MHD_fd_close_chk_(fd) do { \
81  if ( (0 != close ((fd)) && (EBADF == errno)) ) \
82  MHD_PANIC(_("Failed to close FD.\n")); \
83  } while(0)
84 
89 #define EXTRA_CHECKS MHD_NO
90 
91 #define MHD_MAX(a,b) (((a)<(b)) ? (b) : (a))
92 #define MHD_MIN(a,b) (((a)<(b)) ? (a) : (b))
93 
94 
102 #define MHD_BUF_INC_SIZE 1024
103 
104 
109 
113 extern void *mhd_panic_cls;
114 
115 /* If we have Clang or gcc >= 4.5, use __buildin_unreachable() */
116 #if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
117 #define BUILTIN_NOT_REACHED __builtin_unreachable()
118 #elif defined(_MSC_FULL_VER)
119 #define BUILTIN_NOT_REACHED __assume(0)
120 #else
121 #define BUILTIN_NOT_REACHED
122 #endif
123 
124 #ifndef MHD_STATICSTR_LEN_
125 
128 #define MHD_STATICSTR_LEN_(macro) (sizeof(macro)/sizeof(char) - 1)
129 #endif /* ! MHD_STATICSTR_LEN_ */
130 
131 
136 {
137 
143 
149 
155 
160 
165 
170 
175 };
176 
177 
182 {
187 
192 
197 
202 };
203 
204 
209 #define MHD_TEST_ALLOW_SUSPEND_RESUME 8192
210 
217 #define MAX_NONCE_LENGTH 129
218 
219 
225 {
226 
231  uint64_t nc;
232 
237  uint64_t nmask;
238 
243 
244 };
245 
246 #ifdef HAVE_MESSAGES
247 
251 void
252 MHD_DLOG (const struct MHD_Daemon *daemon,
253  const char *format,
254  ...);
255 #endif
256 
257 
261 struct MHD_HTTP_Header
262 {
266  struct MHD_HTTP_Header *next;
267 
271  char *header;
272 
276  size_t header_size;
277 
281  char *value;
282 
286  size_t value_size;
287 
292  enum MHD_ValueKind kind;
293 
294 };
295 
296 
300 struct MHD_Response
301 {
302 
309 
314  char *data;
315 
320  void *crc_cls;
321 
327 
333 
334 #ifdef UPGRADE_SUPPORT
335 
340  MHD_UpgradeHandler upgrade_handler;
341 
345  void *upgrade_handler_cls;
346 #endif /* UPGRADE_SUPPORT */
347 
348 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
349 
353  MHD_mutex_ mutex;
354 #endif
355 
359  uint64_t total_size;
360 
365  uint64_t data_start;
366 
370  uint64_t fd_off;
371 
376  size_t data_size;
377 
381  size_t data_buffer_size;
382 
387  unsigned int reference_count;
388 
392  int fd;
393 
398 
399 };
400 
401 
418 {
424 
429 
434 
439 
444 
449 
454 
459 
465 
471 
477 
482 
487 
493 
498 
503 
508 
513 
518 
523 
524 #ifdef UPGRADE_SUPPORT
525 
529  MHD_CONNECTION_UPGRADE
530 #endif /* UPGRADE_SUPPORT */
531 
532 };
533 
534 
539 {
550 };
551 
555 #define DEBUG_STATES MHD_NO
556 
557 
558 #ifdef HAVE_MESSAGES
559 #if DEBUG_STATES
560 const char *
561 MHD_state_to_string (enum MHD_CONNECTION_STATE state);
562 #endif
563 #endif
564 
573 typedef ssize_t
575  void *write_to,
576  size_t max_bytes);
577 
578 
587 typedef ssize_t
589  const void *read_from,
590  size_t max_bytes);
591 
592 
597 {
602 
607 
612 };
613 
614 
618 struct MHD_Connection
619 {
620 
621 #ifdef EPOLL_SUPPORT
622 
625  struct MHD_Connection *nextE;
626 
630  struct MHD_Connection *prevE;
631 #endif
632 
636  struct MHD_Connection *next;
637 
641  struct MHD_Connection *prev;
642 
650  struct MHD_Connection *nextX;
651 
655  struct MHD_Connection *prevX;
656 
660  struct MHD_Daemon *daemon;
661 
666 
671 
676 
685  struct MemoryPool *pool;
686 
694 
702  void *socket_context;
703 
707  char *method;
708 
713  const char *url;
714 
719  char *version;
720 
727 
733  char *read_buffer;
734 
740 
747  char *last;
748 
756  char *colon;
757 
762  struct sockaddr *addr;
763 
764 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
765 
769  MHD_thread_handle_ID_ pid;
770 #endif
771 
779 
785 
790 
795 
801 
806  size_t header_size;
807 
813 
820 
821 #if defined(_MHD_HAVE_SENDFILE)
822  enum MHD_resp_sender_
823  {
824  MHD_resp_sender_std = 0,
825  MHD_resp_sender_sendfile
826  } resp_sender;
827 #endif /* _MHD_HAVE_SENDFILE */
828 
834 
838  socklen_t addr_len;
839 
844  time_t last_activity;
845 
850  time_t connection_timeout;
851 
856 
863 
870 
874  bool sk_nonblck;
875 
881 
887 
894  bool read_closed;
895 
896 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
897 
900  bool thread_joined;
901 #endif
902 
907  bool in_idle;
908 
914 
915 #ifdef EPOLL_SUPPORT
916 
919  enum MHD_EpollState epoll_state;
920 #endif
921 
926 
931 
936  unsigned int responseCode;
937 
946 
954 
960 
965 
970 
971 #ifdef UPGRADE_SUPPORT
972 
978  struct MHD_UpgradeResponseHandle *urh;
979 #endif /* UPGRADE_SUPPORT */
980 
981 #ifdef HTTPS_SUPPORT
982 
986  gnutls_session_t tls_session;
987 
991  int protocol;
992 
996  int cipher;
997 
1001  enum MHD_TLS_CONN_STATE tls_state;
1002 
1007  bool tls_read_ready;
1008 #endif /* HTTPS_SUPPORT */
1009 
1013  bool suspended;
1014 
1019 
1023  bool resuming;
1024 };
1025 
1026 
1027 #ifdef UPGRADE_SUPPORT
1028 
1037 #define RESERVE_EBUF_SIZE 8
1038 
1045 struct UpgradeEpollHandle
1046 {
1051  struct MHD_UpgradeResponseHandle *urh;
1052 
1068  MHD_socket socket;
1069 
1073  enum MHD_EpollState celi;
1074 
1075 };
1076 
1077 
1083 struct MHD_UpgradeResponseHandle
1084 {
1090  struct MHD_Connection *connection;
1091 
1092 #ifdef HTTPS_SUPPORT
1093 
1096  struct MHD_UpgradeResponseHandle *next;
1097 
1101  struct MHD_UpgradeResponseHandle *prev;
1102 
1103 #ifdef EPOLL_SUPPORT
1104 
1107  struct MHD_UpgradeResponseHandle *nextE;
1108 
1112  struct MHD_UpgradeResponseHandle *prevE;
1113 
1117  bool in_eready_list;
1118 #endif
1119 
1125  char *in_buffer;
1126 
1132  char *out_buffer;
1133 
1139  size_t in_buffer_size;
1140 
1146  size_t out_buffer_size;
1147 
1155  size_t in_buffer_used;
1156 
1164  size_t out_buffer_used;
1165 
1169  struct UpgradeEpollHandle app;
1170 
1175  struct UpgradeEpollHandle mhd;
1176 
1181  char e_buf[RESERVE_EBUF_SIZE];
1182 
1183 #endif /* HTTPS_SUPPORT */
1184 
1195  volatile bool was_closed;
1196 
1218  bool clean_ready;
1219 };
1220 #endif /* UPGRADE_SUPPORT */
1221 
1222 
1231 typedef void *
1232 (*LogCallback)(void *cls,
1233  const char *uri,
1234  struct MHD_Connection *con);
1235 
1245 typedef size_t
1246 (*UnescapeCallback)(void *cls,
1247  struct MHD_Connection *conn,
1248  char *uri);
1249 
1250 
1258 struct MHD_Daemon
1259 {
1260 
1265 
1270 
1275 
1280 
1285 
1290 
1294  struct MHD_Connection *cleanup_head;
1295 
1299  struct MHD_Connection *cleanup_tail;
1300 
1301 #ifdef EPOLL_SUPPORT
1302 
1305  struct MHD_Connection *eready_head;
1306 
1310  struct MHD_Connection *eready_tail;
1311 
1312 #ifdef UPGRADE_SUPPORT
1313 
1316  struct MHD_UpgradeResponseHandle *eready_urh_head;
1317 
1321  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1322 #endif /* UPGRADE_SUPPORT */
1323 #endif /* EPOLL_SUPPORT */
1324 
1340 
1347 
1355 
1362 
1368 
1372  void *apc_cls;
1373 
1379 
1384 
1390 
1395 
1404 
1409 
1414 
1419 
1420 #ifdef HAVE_MESSAGES
1421 
1425  MHD_LogCallback custom_error_log;
1426 
1430  void *custom_error_log_cls;
1431 #endif
1432 
1436  struct MHD_Daemon *master;
1437 
1438 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1439 
1442  struct MHD_Daemon *worker_pool;
1443 #endif
1444 
1449 
1453  size_t pool_size;
1454 
1459 
1460 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1461 
1464  size_t thread_stack_size;
1465 
1469  unsigned int worker_pool_size;
1470 
1474  MHD_thread_handle_ID_ pid;
1475 
1479  MHD_mutex_ per_ip_connection_mutex;
1480 
1485  MHD_mutex_ cleanup_connection_mutex;
1486 #endif
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 
1802 
1811 #define XDLL_insert(head,tail,element) do { \
1812  mhd_assert (NULL == (element)->nextX); \
1813  mhd_assert (NULL == (element)->prevX); \
1814  (element)->nextX = (head); \
1815  (element)->prevX = NULL; \
1816  if (NULL == (tail)) \
1817  (tail) = element; \
1818  else \
1819  (head)->prevX = element; \
1820  (head) = (element); } while (0)
1821 
1822 
1832 #define XDLL_remove(head,tail,element) do { \
1833  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1834  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1835  if (NULL == (element)->prevX) \
1836  (head) = (element)->nextX; \
1837  else \
1838  (element)->prevX->nextX = (element)->nextX; \
1839  if (NULL == (element)->nextX) \
1840  (tail) = (element)->prevX; \
1841  else \
1842  (element)->nextX->prevX = (element)->prevX; \
1843  (element)->nextX = NULL; \
1844  (element)->prevX = NULL; } while (0)
1845 
1846 
1855 #define EDLL_insert(head,tail,element) do { \
1856  (element)->nextE = (head); \
1857  (element)->prevE = NULL; \
1858  if ((tail) == NULL) \
1859  (tail) = element; \
1860  else \
1861  (head)->prevE = element; \
1862  (head) = (element); } while (0)
1863 
1864 
1874 #define EDLL_remove(head,tail,element) do { \
1875  if ((element)->prevE == NULL) \
1876  (head) = (element)->nextE; \
1877  else \
1878  (element)->prevE->nextE = (element)->nextE; \
1879  if ((element)->nextE == NULL) \
1880  (tail) = (element)->prevE; \
1881  else \
1882  (element)->nextE->prevE = (element)->prevE; \
1883  (element)->nextE = NULL; \
1884  (element)->prevE = NULL; } while (0)
1885 
1886 
1892 void
1893 MHD_unescape_plus (char *arg);
1894 
1895 
1909 typedef int
1911  const char *key,
1912  size_t key_size,
1913  const char *value,
1914  size_t value_size,
1915  enum MHD_ValueKind kind);
1916 
1917 
1932 int
1933 MHD_parse_arguments_ (struct MHD_Connection *connection,
1934  enum MHD_ValueKind kind,
1935  char *args,
1937  unsigned int *num_headers);
1938 
1939 
1956 bool
1958  const char *key,
1959  size_t key_len,
1960  const char *token,
1961  size_t token_len);
1962 
1974 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1975  MHD_check_response_header_token_ci((r),(k),MHD_STATICSTR_LEN_(k),\
1976  (tkn),MHD_STATICSTR_LEN_(tkn))
1977 
1978 
1988 void
1989 internal_suspend_connection_ (struct MHD_Connection *connection);
1990 
1991 #endif
bool thread_joined
Definition: internal.h:776
unsigned int per_ip_connection_limit
Definition: internal.h:1595
void * unescape_callback_cls
Definition: internal.h:1418
uint64_t total_size
Definition: internal.h:1639
bool have_chunked_upload
Definition: internal.h:945
additional automatic macros for MHD_config.h
uint64_t fd_off
Definition: internal.h:1650
uint64_t current_chunk_offset
Definition: internal.h:959
bool data_already_pending
Definition: internal.h:1497
socklen_t addr_len
Definition: internal.h:730
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
Definition: microhttpd.h:1310
struct MHD_Connection * cleanup_head
Definition: internal.h:1174
enum MHD_CONNECTION_STATE state
Definition: internal.h:925
uint64_t response_write_position
Definition: internal.h:819
public interface to libmicrohttpd
enum MHD_ConnKeepAlive keepalive
Definition: internal.h:726
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:179
enum MHD_ConnectionEventLoopInfo event_loop_info
Definition: internal.h:930
struct MHD_Connection * prevX
Definition: internal.h:667
MHD_thread_handle_ID_ pid
Definition: internal.h:1246
time_t connection_timeout
Definition: internal.h:1589
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1603
MHD_PanicCallback mhd_panic
Definition: panic.c:31
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2268
MHD_CONNECTION_STATE
Definition: internal.h:417
char * version
Definition: internal.h:719
int suspended_dummy
Definition: internal.h:1018
struct MHD_Response * response
Definition: internal.h:675
char * data
Definition: internal.h:1585
char * colon
Definition: internal.h:756
char * write_buffer
Definition: internal.h:739
volatile bool was_quiesced
Definition: internal.h:1548
struct MHD_Connection * manual_timeout_head
Definition: internal.h:1140
size_t data_size
Definition: internal.h:1656
void *(* LogCallback)(void *cls, const char *uri, struct MHD_Connection *con)
Definition: internal.h:1232
MHD_thread_handle_ID_ pid
Definition: internal.h:720
char * value
Definition: internal.h:349
enum MHD_ValueKind kind
Definition: internal.h:355
MHD_AccessHandlerCallback default_handler
Definition: internal.h:1264
int MHD_socket
Definition: microhttpd.h:187
uint64_t remaining_upload_size
Definition: internal.h:812
unsigned int responseCode
Definition: internal.h:936
platform-specific includes for libmicrohttpd
char * header
Definition: internal.h:344
void * uri_log_callback_cls
Definition: internal.h:1408
struct MHD_Daemon * daemon
Definition: internal.h:672
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:2044
size_t header_size
Definition: internal.h:806
Types for platform-independent inter-thread communication.
void(* MHD_LogCallback)(void *cls, const char *fm, va_list ap)
Definition: microhttpd.h:1292
int listening_address_reuse
Definition: internal.h:1502
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1256
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1389
struct MHD_Connection * next
Definition: internal.h:648
bool client_aware
Definition: internal.h:862
int strict_for_client
Definition: internal.h:1610
void * socket_context
Definition: internal.h:691
struct MHD_HTTP_Header * first_header
Definition: internal.h:1579
uint64_t nmask
Definition: internal.h:237
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:321
size_t data_buffer_size
Definition: internal.h:1661
size_t write_buffer_send_offset
Definition: internal.h:794
void * crc_cls
Definition: internal.h:1591
struct MHD_Connection * connections_tail
Definition: internal.h:1157
struct MHD_Daemon * worker_pool
Definition: internal.h:1070
size_t read_buffer_size
Definition: internal.h:778
bool sk_tcp_cork_nopush_on
Definition: internal.h:886
macros for mhd_assert()
void * client_context
Definition: internal.h:693
const char * url
Definition: internal.h:713
size_t continue_message_write_offset
Definition: internal.h:833
MHD_socket socket_fd
Definition: internal.h:749
bool MHD_parse_arguments_(struct MHD_Request *request, enum MHD_ValueKind kind, char *args, MHD_ArgumentIterator_ cb, unsigned int *num_headers)
Definition: internal.c:186
char * method
Definition: internal.h:707
unsigned int connection_limit
Definition: internal.h:1583
char nonce[MAX_NONCE_LENGTH]
Definition: internal.h:242
unsigned int worker_pool_size
Definition: internal.h:1363
enum MHD_FLAG options
Definition: internal.h:1600
struct MHD_Connection * connections_head
Definition: internal.h:1152
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2772
LogCallback uri_log_callback
Definition: internal.h:1403
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2252
bool in_cleanup
Definition: internal.h:913
unsigned int reference_count
Definition: internal.h:1672
time_t connection_timeout
Definition: internal.h:742
bool sk_tcp_nodelay_on
Definition: internal.h:880
ssize_t(* TransmitCallback)(struct MHD_Connection *conn, const void *read_from, size_t max_bytes)
Definition: internal.h:193
#define MAX_NONCE_LENGTH
Definition: internal.h:217
struct MHD_Daemon * master
Definition: internal.h:1065
struct MHD_Connection * manual_timeout_tail
Definition: internal.h:1147
uint16_t port
Definition: internal.h:1605
char * last
Definition: internal.h:747
unsigned int connections
Definition: internal.h:1358
struct MHD_Connection * prev
Definition: internal.h:653
MHD_ValueKind
Definition: microhttpd.h:1695
char * read_buffer
Definition: internal.h:733
MHD_EpollState
Definition: internal.h:584
ReceiveCallback recv_cls
Definition: internal.h:703
size_t value_size
Definition: internal.h:286
size_t write_buffer_size
Definition: internal.h:789
uint64_t data_start
Definition: internal.h:1645
struct MHD_Connection * normal_timeout_head
Definition: internal.h:1125
struct MHD_Connection * nextX
Definition: internal.h:662
UnescapeCallback unescape_callback
Definition: internal.h:1413
size_t header_size
Definition: internal.h:276
unsigned int listen_backlog_size
Definition: internal.h:1754
unsigned int connection_timeout_dummy
Definition: internal.h:855
struct MHD_Connection * suspended_connections_tail
Definition: internal.h:1169
size_t pool_size
Definition: internal.h:1453
bool tls_read_ready
Definition: internal.h:766
struct MHD_itc_ itc
Definition: internal.h:1407
MHD_AcceptPolicyCallback apc
Definition: internal.h:1367
time_t last_activity
Definition: internal.h:736
struct MHD_Connection * cleanup_tail
Definition: internal.h:1179
int(* 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:2103
bool sk_nonblck
Definition: internal.h:781
enum MHD_ResponseFlags flags
Definition: internal.h:397
uint64_t nc
Definition: internal.h:231
struct MHD_HTTP_Header * next
Definition: internal.h:339
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:2126
size_t write_buffer_append_offset
Definition: internal.h:800
MHD_ConnKeepAlive
Definition: internal.h:151
struct MHD_Connection * normal_timeout_tail
Definition: internal.h:1132
MHD_RequestCompletedCallback notify_completed
Definition: internal.h:1378
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:3214
bool resuming
Definition: internal.h:1507
bool read_closed
Definition: internal.h:789
void * notify_completed_cls
Definition: internal.h:1383
MHD_socket listen_fd
Definition: internal.h:1491
struct MemoryPool * pool
Definition: internal.h:682
TransmitCallback send_cls
Definition: internal.h:708
bool(* MHD_ArgumentIterator_)(struct MHD_Request *request, const char *key, const char *value, enum MHD_ValueKind kind)
Definition: internal.h:1705
size_t(* UnescapeCallback)(void *cls, struct MHD_Connection *conn, char *uri)
Definition: internal.h:1246
void * notify_connection_cls
Definition: internal.h:1394
void * apc_cls
Definition: internal.h:1372
MHD_ContentReaderCallback crc
Definition: internal.h:1597
bool at_limit
Definition: internal.h:1480
struct sockaddr * addr
Definition: internal.h:762
MHD_mutex_ mutex
Definition: internal.h:1634
bool suspended
Definition: internal.h:761
MHD_ConnectionEventLoopInfo
Definition: internal.h:181
struct MHD_Connection * suspended_connections_head
Definition: internal.h:1163
void * per_ip_connection_count
Definition: internal.h:1184
size_t read_buffer_offset
Definition: internal.h:784
void * default_handler_cls
Definition: internal.h:1269
volatile bool shutdown
Definition: internal.h:1523
MHD_ResponseFlags
Definition: microhttpd.h:2865
MHD_TLS_CONN_STATE
Definition: internal.h:538
MHD_mutex_ cleanup_connection_mutex
Definition: internal.h:1262
uint64_t current_chunk_size
Definition: internal.h:953
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2058
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2152
struct MHD_HTTP_Header * headers_received
Definition: internal.h:665
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1004
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:670
size_t pool_increment
Definition: internal.h:1458
void MHD_unescape_plus(char *arg)
Definition: internal.c:119