GNU libmicrohttpd  0.9.61
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 #include "mhd_threads.h"
69 #include "mhd_locks.h"
70 #include "mhd_sockets.h"
71 #include "mhd_itc_types.h"
72 
73 
78 #define MHD_fd_close_chk_(fd) do { \
79  if (0 == close ((fd)) && (EBADF == errno)) \
80  MHD_PANIC(_("Failed to close FD.\n")); \
81  } while(0)
82 
87 #define EXTRA_CHECKS MHD_NO
88 
89 #define MHD_MAX(a,b) (((a)<(b)) ? (b) : (a))
90 #define MHD_MIN(a,b) (((a)<(b)) ? (a) : (b))
91 
92 
100 #define MHD_BUF_INC_SIZE 1024
101 
102 
107 
111 extern void *mhd_panic_cls;
112 
113 /* If we have Clang or gcc >= 4.5, use __buildin_unreachable() */
114 #if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
115 #define BUILTIN_NOT_REACHED __builtin_unreachable()
116 #elif defined(_MSC_FULL_VER)
117 #define BUILTIN_NOT_REACHED __assume(0)
118 #else
119 #define BUILTIN_NOT_REACHED
120 #endif
121 
122 #ifndef MHD_STATICSTR_LEN_
123 
126 #define MHD_STATICSTR_LEN_(macro) (sizeof(macro)/sizeof(char) - 1)
127 #endif /* ! MHD_STATICSTR_LEN_ */
128 
129 
134 {
135 
141 
147 
153 
158 
163 
168 
173 };
174 
175 
180 {
185 
190 
195 
200 };
201 
202 
207 #define MHD_TEST_ALLOW_SUSPEND_RESUME 8192
208 
215 #define MAX_NONCE_LENGTH 129
216 
217 
223 {
224 
229  uint64_t nc;
230 
235  uint64_t nmask;
236 
241 
242 };
243 
244 #ifdef HAVE_MESSAGES
245 
249 void
250 MHD_DLOG (const struct MHD_Daemon *daemon,
251  const char *format,
252  ...);
253 #endif
254 
255 
259 struct MHD_HTTP_Header
260 {
264  struct MHD_HTTP_Header *next;
265 
269  char *header;
270 
274  char *value;
275 
280  enum MHD_ValueKind kind;
281 
282 };
283 
284 
288 struct MHD_Response
289 {
290 
297 
302  char *data;
303 
308  void *crc_cls;
309 
315 
321 
322 #ifdef UPGRADE_SUPPORT
323 
328  MHD_UpgradeHandler upgrade_handler;
329 
333  void *upgrade_handler_cls;
334 #endif /* UPGRADE_SUPPORT */
335 
340  MHD_mutex_ mutex;
341 
345  uint64_t total_size;
346 
351  uint64_t data_start;
352 
356  uint64_t fd_off;
357 
362  size_t data_size;
363 
367  size_t data_buffer_size;
368 
373  unsigned int reference_count;
374 
378  int fd;
379 
384 
385 };
386 
387 
404 {
410 
415 
420 
425 
430 
435 
440 
445 
451 
457 
463 
468 
473 
479 
484 
489 
494 
499 
504 
509 
510 #ifdef UPGRADE_SUPPORT
511 
515  MHD_CONNECTION_UPGRADE
516 #endif /* UPGRADE_SUPPORT */
517 
518 };
519 
520 
525 {
536 };
537 
541 #define DEBUG_STATES MHD_NO
542 
543 
544 #ifdef HAVE_MESSAGES
545 #if DEBUG_STATES
546 const char *
547 MHD_state_to_string (enum MHD_CONNECTION_STATE state);
548 #endif
549 #endif
550 
559 typedef ssize_t
561  void *write_to,
562  size_t max_bytes);
563 
564 
573 typedef ssize_t
575  const void *read_from,
576  size_t max_bytes);
577 
578 
583 {
588 
593 
598 };
599 
603 struct MHD_Connection
604 {
605 
606 #ifdef EPOLL_SUPPORT
607 
610  struct MHD_Connection *nextE;
611 
615  struct MHD_Connection *prevE;
616 #endif
617 
621  struct MHD_Connection *next;
622 
626  struct MHD_Connection *prev;
627 
635  struct MHD_Connection *nextX;
636 
640  struct MHD_Connection *prevX;
641 
645  struct MHD_Daemon *daemon;
646 
651 
656 
661 
670  struct MemoryPool *pool;
671 
679 
687  void *socket_context;
688 
692  char *method;
693 
698  const char *url;
699 
704  char *version;
705 
712 
718  char *read_buffer;
719 
725 
732  char *last;
733 
741  char *colon;
742 
747  struct sockaddr *addr;
748 
753  MHD_thread_handle_ID_ pid;
754 
762 
768 
773 
778 
784 
789  size_t header_size;
790 
796 
803 
804 #if defined(_MHD_HAVE_SENDFILE)
805  enum MHD_resp_sender_
806  {
807  MHD_resp_sender_std = 0,
808  MHD_resp_sender_sendfile
809  } resp_sender;
810 #endif /* _MHD_HAVE_SENDFILE */
811 
817 
821  socklen_t addr_len;
822 
827  time_t last_activity;
828 
833  time_t connection_timeout;
834 
839 
846 
853 
857  bool sk_nonblck;
858 
865  bool read_closed;
866 
870  bool thread_joined;
871 
876  bool in_idle;
877 
883 
884 #ifdef EPOLL_SUPPORT
885 
888  enum MHD_EpollState epoll_state;
889 #endif
890 
895 
900 
905  unsigned int responseCode;
906 
915 
923 
929 
934 
939 
940 #ifdef UPGRADE_SUPPORT
941 
947  struct MHD_UpgradeResponseHandle *urh;
948 #endif /* UPGRADE_SUPPORT */
949 
950 #ifdef HTTPS_SUPPORT
951 
955  gnutls_session_t tls_session;
956 
960  int protocol;
961 
965  int cipher;
966 
970  enum MHD_TLS_CONN_STATE tls_state;
971 
976  bool tls_read_ready;
977 #endif /* HTTPS_SUPPORT */
978 
982  bool suspended;
983 
988 
992  bool resuming;
993 };
994 
995 
996 #ifdef UPGRADE_SUPPORT
997 
1006 #define RESERVE_EBUF_SIZE 8
1007 
1014 struct UpgradeEpollHandle
1015 {
1020  struct MHD_UpgradeResponseHandle *urh;
1021 
1037  MHD_socket socket;
1038 
1042  enum MHD_EpollState celi;
1043 
1044 };
1045 
1046 
1052 struct MHD_UpgradeResponseHandle
1053 {
1059  struct MHD_Connection *connection;
1060 
1061 #ifdef HTTPS_SUPPORT
1062 
1065  struct MHD_UpgradeResponseHandle *next;
1066 
1070  struct MHD_UpgradeResponseHandle *prev;
1071 
1072 #ifdef EPOLL_SUPPORT
1073 
1076  struct MHD_UpgradeResponseHandle *nextE;
1077 
1081  struct MHD_UpgradeResponseHandle *prevE;
1082 
1086  bool in_eready_list;
1087 #endif
1088 
1094  char *in_buffer;
1095 
1101  char *out_buffer;
1102 
1108  size_t in_buffer_size;
1109 
1115  size_t out_buffer_size;
1116 
1124  size_t in_buffer_used;
1125 
1133  size_t out_buffer_used;
1134 
1138  struct UpgradeEpollHandle app;
1139 
1144  struct UpgradeEpollHandle mhd;
1145 
1150  char e_buf[RESERVE_EBUF_SIZE];
1151 
1152 #endif /* HTTPS_SUPPORT */
1153 
1164  volatile bool was_closed;
1165 
1187  bool clean_ready;
1188 };
1189 #endif /* UPGRADE_SUPPORT */
1190 
1191 
1200 typedef void *
1201 (*LogCallback)(void *cls,
1202  const char *uri,
1203  struct MHD_Connection *con);
1204 
1214 typedef size_t
1215 (*UnescapeCallback)(void *cls,
1216  struct MHD_Connection *conn,
1217  char *uri);
1218 
1219 
1227 struct MHD_Daemon
1228 {
1229 
1234 
1239 
1244 
1249 
1254 
1259 
1263  struct MHD_Connection *cleanup_head;
1264 
1268  struct MHD_Connection *cleanup_tail;
1269 
1270 #ifdef EPOLL_SUPPORT
1271 
1274  struct MHD_Connection *eready_head;
1275 
1279  struct MHD_Connection *eready_tail;
1280 
1281 #ifdef UPGRADE_SUPPORT
1282 
1285  struct MHD_UpgradeResponseHandle *eready_urh_head;
1286 
1290  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1291 #endif /* UPGRADE_SUPPORT */
1292 #endif /* EPOLL_SUPPORT */
1293 
1309 
1316 
1324 
1331 
1337 
1341  void *apc_cls;
1342 
1348 
1353 
1359 
1364 
1373 
1378 
1383 
1388 
1389 #ifdef HAVE_MESSAGES
1390 
1394  void (*custom_error_log) (void *cls, const char *fmt, va_list va);
1395 
1399  void *custom_error_log_cls;
1400 #endif
1401 
1405  struct MHD_Daemon *master;
1406 
1410  struct MHD_Daemon *worker_pool;
1411 
1416 
1420  size_t pool_size;
1421 
1426 
1431 
1435  unsigned int worker_pool_size;
1436 
1440  MHD_thread_handle_ID_ pid;
1441 
1445  MHD_mutex_ per_ip_connection_mutex;
1446 
1451  MHD_mutex_ cleanup_connection_mutex;
1452 
1457 
1468 
1469 #ifdef EPOLL_SUPPORT
1470 
1473  int epoll_fd;
1474 
1479  bool listen_socket_in_epoll;
1480 
1481 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
1482 
1486  int epoll_upgrade_fd;
1487 
1492  bool upgrade_fd_in_epoll;
1493 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
1494 
1495 #endif
1496 
1500  struct MHD_itc_ itc;
1501 
1505  volatile bool shutdown;
1506 
1512  volatile bool was_quiesced;
1513 
1521  bool at_limit;
1522 
1523  /*
1524  * Do we need to process resuming connections?
1525  */
1526  bool resuming;
1527 
1537  bool data_already_pending;
1538 
1542  unsigned int connections;
1543 
1547  unsigned int connection_limit;
1548 
1554 
1560 
1565 
1569  uint16_t port;
1570 
1575 
1576 #ifdef HTTPS_SUPPORT
1577 #ifdef UPGRADE_SUPPORT
1578 
1583  struct MHD_UpgradeResponseHandle *urh_head;
1584 
1590  struct MHD_UpgradeResponseHandle *urh_tail;
1591 #endif /* UPGRADE_SUPPORT */
1592 
1596  gnutls_priority_t priority_cache;
1597 
1602  gnutls_credentials_type_t cred_type;
1603 
1607  gnutls_certificate_credentials_t x509_cred;
1608 
1612  gnutls_dh_params_t dh_params;
1613 
1617  gnutls_psk_server_credentials_t psk_cred;
1618 
1619 #if GNUTLS_VERSION_MAJOR >= 3
1620 
1624  gnutls_certificate_retrieve_function2 *cert_callback;
1625 
1629  MHD_PskServerCredentialsCallback cred_callback;
1630 
1634  void *cred_callback_cls;
1635 #endif
1636 
1640  const char *https_mem_key;
1641 
1645  const char *https_mem_cert;
1646 
1650  const char *https_key_password;
1651 
1655  const char *https_mem_trust;
1656 
1660  gnutls_dh_params_t https_mem_dhparams;
1661 
1665  bool have_dhparams;
1666 
1667 #endif /* HTTPS_SUPPORT */
1668 
1669 #ifdef DAUTH_SUPPORT
1670 
1674  const char *digest_auth_random;
1675 
1679  struct MHD_NonceNc *nnc;
1680 
1684  MHD_mutex_ nnc_lock;
1685 
1689  size_t digest_auth_rand_size;
1690 
1694  unsigned int nonce_nc_size;
1695 
1696 #endif
1697 
1698 #ifdef TCP_FASTOPEN
1699 
1702  unsigned int fastopen_queue_size;
1703 #endif
1704 
1708  unsigned int listen_backlog_size;
1709 };
1710 
1711 
1720 #define DLL_insert(head,tail,element) do { \
1721  mhd_assert (NULL == (element)->next); \
1722  mhd_assert (NULL == (element)->prev); \
1723  (element)->next = (head); \
1724  (element)->prev = NULL; \
1725  if ((tail) == NULL) \
1726  (tail) = element; \
1727  else \
1728  (head)->prev = element; \
1729  (head) = (element); } while (0)
1730 
1731 
1741 #define DLL_remove(head,tail,element) do { \
1742  mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \
1743  mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \
1744  if ((element)->prev == NULL) \
1745  (head) = (element)->next; \
1746  else \
1747  (element)->prev->next = (element)->next; \
1748  if ((element)->next == NULL) \
1749  (tail) = (element)->prev; \
1750  else \
1751  (element)->next->prev = (element)->prev; \
1752  (element)->next = NULL; \
1753  (element)->prev = NULL; } while (0)
1754 
1755 
1756 
1765 #define XDLL_insert(head,tail,element) do { \
1766  mhd_assert (NULL == (element)->nextX); \
1767  mhd_assert (NULL == (element)->prevX); \
1768  (element)->nextX = (head); \
1769  (element)->prevX = NULL; \
1770  if (NULL == (tail)) \
1771  (tail) = element; \
1772  else \
1773  (head)->prevX = element; \
1774  (head) = (element); } while (0)
1775 
1776 
1786 #define XDLL_remove(head,tail,element) do { \
1787  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1788  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1789  if (NULL == (element)->prevX) \
1790  (head) = (element)->nextX; \
1791  else \
1792  (element)->prevX->nextX = (element)->nextX; \
1793  if (NULL == (element)->nextX) \
1794  (tail) = (element)->prevX; \
1795  else \
1796  (element)->nextX->prevX = (element)->prevX; \
1797  (element)->nextX = NULL; \
1798  (element)->prevX = NULL; } while (0)
1799 
1800 
1809 #define EDLL_insert(head,tail,element) do { \
1810  (element)->nextE = (head); \
1811  (element)->prevE = NULL; \
1812  if ((tail) == NULL) \
1813  (tail) = element; \
1814  else \
1815  (head)->prevE = element; \
1816  (head) = (element); } while (0)
1817 
1818 
1828 #define EDLL_remove(head,tail,element) do { \
1829  if ((element)->prevE == NULL) \
1830  (head) = (element)->nextE; \
1831  else \
1832  (element)->prevE->nextE = (element)->nextE; \
1833  if ((element)->nextE == NULL) \
1834  (tail) = (element)->prevE; \
1835  else \
1836  (element)->nextE->prevE = (element)->prevE; \
1837  (element)->nextE = NULL; \
1838  (element)->prevE = NULL; } while (0)
1839 
1840 
1846 void
1847 MHD_unescape_plus (char *arg);
1848 
1849 
1861 typedef int
1863  const char *key,
1864  const char *value,
1865  enum MHD_ValueKind kind);
1866 
1867 
1882 int
1883 MHD_parse_arguments_ (struct MHD_Connection *connection,
1884  enum MHD_ValueKind kind,
1885  char *args,
1887  unsigned int *num_headers);
1888 
1889 
1903 bool
1905  const char *key,
1906  const char *token,
1907  size_t token_len);
1908 
1920 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1921  MHD_check_response_header_token_ci((r),(k),(tkn),MHD_STATICSTR_LEN_(tkn))
1922 
1923 
1933 void
1934 internal_suspend_connection_ (struct MHD_Connection *connection);
1935 
1936 #endif
bool thread_joined
Definition: internal.h:776
unsigned int per_ip_connection_limit
Definition: internal.h:1559
void * unescape_callback_cls
Definition: internal.h:1387
uint64_t total_size
Definition: internal.h:1639
bool have_chunked_upload
Definition: internal.h:914
additional automatic macros for MHD_config.h
uint64_t fd_off
Definition: internal.h:1650
uint64_t current_chunk_offset
Definition: internal.h:928
bool data_already_pending
Definition: internal.h:1497
bool MHD_check_response_header_token_ci(const struct MHD_Response *response, const char *key, const char *token, size_t token_len)
Definition: response.c:292
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:1182
struct MHD_Connection * cleanup_head
Definition: internal.h:1174
enum MHD_CONNECTION_STATE state
Definition: internal.h:894
uint64_t response_write_position
Definition: internal.h:802
public interface to libmicrohttpd
enum MHD_ConnKeepAlive keepalive
Definition: internal.h:711
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:899
struct MHD_Connection * prevX
Definition: internal.h:667
MHD_thread_handle_ID_ pid
Definition: internal.h:1246
time_t connection_timeout
Definition: internal.h:1553
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1603
MHD_PanicCallback mhd_panic
Definition: panic.c:31
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2100
MHD_CONNECTION_STATE
Definition: internal.h:403
char * version
Definition: internal.h:704
int suspended_dummy
Definition: internal.h:987
struct MHD_Response * response
Definition: internal.h:660
char * data
Definition: internal.h:1585
char * colon
Definition: internal.h:741
char * write_buffer
Definition: internal.h:724
volatile bool was_quiesced
Definition: internal.h:1512
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:1201
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:1233
int MHD_socket
Definition: microhttpd.h:181
uint64_t remaining_upload_size
Definition: internal.h:795
unsigned int responseCode
Definition: internal.h:905
platform-specific includes for libmicrohttpd
char * header
Definition: internal.h:344
void * uri_log_callback_cls
Definition: internal.h:1377
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:1903
size_t header_size
Definition: internal.h:789
Types for platform-independent inter-thread communication.
int listening_address_reuse
Definition: internal.h:1467
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1256
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1358
struct MHD_Connection * next
Definition: internal.h:648
bool client_aware
Definition: internal.h:845
int strict_for_client
Definition: internal.h:1574
void * socket_context
Definition: internal.h:691
struct MHD_HTTP_Header * first_header
Definition: internal.h:1579
uint64_t nmask
Definition: internal.h:235
size_t data_buffer_size
Definition: internal.h:1661
size_t write_buffer_send_offset
Definition: internal.h:777
void * crc_cls
Definition: internal.h:1591
struct MHD_Connection * connections_tail
Definition: internal.h:1157
size_t read_buffer_size
Definition: internal.h:761
macros for mhd_assert()
void * client_context
Definition: internal.h:678
const char * url
Definition: internal.h:698
size_t continue_message_write_offset
Definition: internal.h:816
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:692
unsigned int connection_limit
Definition: internal.h:1547
char nonce[MAX_NONCE_LENGTH]
Definition: internal.h:240
unsigned int worker_pool_size
Definition: internal.h:1363
enum MHD_FLAG options
Definition: internal.h:1564
struct MHD_Connection * connections_head
Definition: internal.h:1152
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2650
LogCallback uri_log_callback
Definition: internal.h:1372
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2084
bool in_cleanup
Definition: internal.h:882
unsigned int reference_count
Definition: internal.h:1672
time_t connection_timeout
Definition: internal.h:742
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:215
struct MHD_Daemon * master
Definition: internal.h:1065
struct MHD_Connection * manual_timeout_tail
Definition: internal.h:1147
uint16_t port
Definition: internal.h:1569
char * last
Definition: internal.h:732
unsigned int connections
Definition: internal.h:1358
struct MHD_Connection * prev
Definition: internal.h:653
MHD_ValueKind
Definition: microhttpd.h:1554
char * read_buffer
Definition: internal.h:718
MHD_EpollState
Definition: internal.h:584
ReceiveCallback recv_cls
Definition: internal.h:703
size_t thread_stack_size
Definition: internal.h:1430
size_t write_buffer_size
Definition: internal.h:772
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:1382
unsigned int listen_backlog_size
Definition: internal.h:1708
unsigned int connection_timeout_dummy
Definition: internal.h:838
struct MHD_Connection * suspended_connections_tail
Definition: internal.h:1169
size_t pool_size
Definition: internal.h:1420
bool tls_read_ready
Definition: internal.h:766
struct MHD_itc_ itc
Definition: internal.h:1407
MHD_AcceptPolicyCallback apc
Definition: internal.h:1336
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:1962
bool sk_nonblck
Definition: internal.h:781
enum MHD_ResponseFlags flags
Definition: internal.h:383
uint64_t nc
Definition: internal.h:229
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:1985
size_t write_buffer_append_offset
Definition: internal.h:783
MHD_ConnKeepAlive
Definition: internal.h:151
struct MHD_Connection * normal_timeout_tail
Definition: internal.h:1132
MHD_RequestCompletedCallback notify_completed
Definition: internal.h:1347
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:2964
bool resuming
Definition: internal.h:1507
bool read_closed
Definition: internal.h:789
void * notify_completed_cls
Definition: internal.h:1352
MHD_socket listen_fd
Definition: internal.h:1456
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:1215
void * notify_connection_cls
Definition: internal.h:1363
Header for platform-independent locks abstraction.
void * apc_cls
Definition: internal.h:1341
MHD_ContentReaderCallback crc
Definition: internal.h:1597
bool at_limit
Definition: internal.h:1480
struct sockaddr * addr
Definition: internal.h:747
MHD_mutex_ mutex
Definition: internal.h:1634
bool suspended
Definition: internal.h:761
MHD_ConnectionEventLoopInfo
Definition: internal.h:179
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:767
void * default_handler_cls
Definition: internal.h:1238
volatile bool shutdown
Definition: internal.h:1523
MHD_ResponseFlags
Definition: microhttpd.h:2615
MHD_TLS_CONN_STATE
Definition: internal.h:524
MHD_mutex_ cleanup_connection_mutex
Definition: internal.h:1262
uint64_t current_chunk_size
Definition: internal.h:922
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:1917
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2011
struct MHD_HTTP_Header * headers_received
Definition: internal.h:650
struct MHD_Daemon * worker_pool
Definition: internal.h:1070
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:888
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:655
size_t pool_increment
Definition: internal.h:1425
void MHD_unescape_plus(char *arg)
Definition: internal.c:119
Header for platform-independent threads abstraction.