GNU libmicrohttpd  0.9.63
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  char *value;
277 
282  enum MHD_ValueKind kind;
283 
284 };
285 
286 
290 struct MHD_Response
291 {
292 
299 
304  char *data;
305 
310  void *crc_cls;
311 
317 
323 
324 #ifdef UPGRADE_SUPPORT
325 
330  MHD_UpgradeHandler upgrade_handler;
331 
335  void *upgrade_handler_cls;
336 #endif /* UPGRADE_SUPPORT */
337 
338 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
339 
343  MHD_mutex_ mutex;
344 #endif
345 
349  uint64_t total_size;
350 
355  uint64_t data_start;
356 
360  uint64_t fd_off;
361 
366  size_t data_size;
367 
371  size_t data_buffer_size;
372 
377  unsigned int reference_count;
378 
382  int fd;
383 
388 
389 };
390 
391 
408 {
414 
419 
424 
429 
434 
439 
444 
449 
455 
461 
467 
472 
477 
483 
488 
493 
498 
503 
508 
513 
514 #ifdef UPGRADE_SUPPORT
515 
519  MHD_CONNECTION_UPGRADE
520 #endif /* UPGRADE_SUPPORT */
521 
522 };
523 
524 
529 {
540 };
541 
545 #define DEBUG_STATES MHD_NO
546 
547 
548 #ifdef HAVE_MESSAGES
549 #if DEBUG_STATES
550 const char *
551 MHD_state_to_string (enum MHD_CONNECTION_STATE state);
552 #endif
553 #endif
554 
563 typedef ssize_t
565  void *write_to,
566  size_t max_bytes);
567 
568 
577 typedef ssize_t
579  const void *read_from,
580  size_t max_bytes);
581 
582 
587 {
592 
597 
602 };
603 
604 
608 struct MHD_Connection
609 {
610 
611 #ifdef EPOLL_SUPPORT
612 
615  struct MHD_Connection *nextE;
616 
620  struct MHD_Connection *prevE;
621 #endif
622 
626  struct MHD_Connection *next;
627 
631  struct MHD_Connection *prev;
632 
640  struct MHD_Connection *nextX;
641 
645  struct MHD_Connection *prevX;
646 
650  struct MHD_Daemon *daemon;
651 
656 
661 
666 
675  struct MemoryPool *pool;
676 
684 
692  void *socket_context;
693 
697  char *method;
698 
703  const char *url;
704 
709  char *version;
710 
717 
723  char *read_buffer;
724 
730 
737  char *last;
738 
746  char *colon;
747 
752  struct sockaddr *addr;
753 
754 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
755 
759  MHD_thread_handle_ID_ pid;
760 #endif
761 
769 
775 
780 
785 
791 
796  size_t header_size;
797 
803 
810 
811 #if defined(_MHD_HAVE_SENDFILE)
812  enum MHD_resp_sender_
813  {
814  MHD_resp_sender_std = 0,
815  MHD_resp_sender_sendfile
816  } resp_sender;
817 #endif /* _MHD_HAVE_SENDFILE */
818 
824 
828  socklen_t addr_len;
829 
834  time_t last_activity;
835 
840  time_t connection_timeout;
841 
846 
853 
860 
864  bool sk_nonblck;
865 
871 
877 
884  bool read_closed;
885 
886 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
887 
890  bool thread_joined;
891 #endif
892 
897  bool in_idle;
898 
904 
905 #ifdef EPOLL_SUPPORT
906 
909  enum MHD_EpollState epoll_state;
910 #endif
911 
916 
921 
926  unsigned int responseCode;
927 
936 
944 
950 
955 
960 
961 #ifdef UPGRADE_SUPPORT
962 
968  struct MHD_UpgradeResponseHandle *urh;
969 #endif /* UPGRADE_SUPPORT */
970 
971 #ifdef HTTPS_SUPPORT
972 
976  gnutls_session_t tls_session;
977 
981  int protocol;
982 
986  int cipher;
987 
991  enum MHD_TLS_CONN_STATE tls_state;
992 
997  bool tls_read_ready;
998 #endif /* HTTPS_SUPPORT */
999 
1003  bool suspended;
1004 
1009 
1013  bool resuming;
1014 };
1015 
1016 
1017 #ifdef UPGRADE_SUPPORT
1018 
1027 #define RESERVE_EBUF_SIZE 8
1028 
1035 struct UpgradeEpollHandle
1036 {
1041  struct MHD_UpgradeResponseHandle *urh;
1042 
1058  MHD_socket socket;
1059 
1063  enum MHD_EpollState celi;
1064 
1065 };
1066 
1067 
1073 struct MHD_UpgradeResponseHandle
1074 {
1080  struct MHD_Connection *connection;
1081 
1082 #ifdef HTTPS_SUPPORT
1083 
1086  struct MHD_UpgradeResponseHandle *next;
1087 
1091  struct MHD_UpgradeResponseHandle *prev;
1092 
1093 #ifdef EPOLL_SUPPORT
1094 
1097  struct MHD_UpgradeResponseHandle *nextE;
1098 
1102  struct MHD_UpgradeResponseHandle *prevE;
1103 
1107  bool in_eready_list;
1108 #endif
1109 
1115  char *in_buffer;
1116 
1122  char *out_buffer;
1123 
1129  size_t in_buffer_size;
1130 
1136  size_t out_buffer_size;
1137 
1145  size_t in_buffer_used;
1146 
1154  size_t out_buffer_used;
1155 
1159  struct UpgradeEpollHandle app;
1160 
1165  struct UpgradeEpollHandle mhd;
1166 
1171  char e_buf[RESERVE_EBUF_SIZE];
1172 
1173 #endif /* HTTPS_SUPPORT */
1174 
1185  volatile bool was_closed;
1186 
1208  bool clean_ready;
1209 };
1210 #endif /* UPGRADE_SUPPORT */
1211 
1212 
1221 typedef void *
1222 (*LogCallback)(void *cls,
1223  const char *uri,
1224  struct MHD_Connection *con);
1225 
1235 typedef size_t
1236 (*UnescapeCallback)(void *cls,
1237  struct MHD_Connection *conn,
1238  char *uri);
1239 
1240 
1248 struct MHD_Daemon
1249 {
1250 
1255 
1260 
1265 
1270 
1275 
1280 
1284  struct MHD_Connection *cleanup_head;
1285 
1289  struct MHD_Connection *cleanup_tail;
1290 
1291 #ifdef EPOLL_SUPPORT
1292 
1295  struct MHD_Connection *eready_head;
1296 
1300  struct MHD_Connection *eready_tail;
1301 
1302 #ifdef UPGRADE_SUPPORT
1303 
1306  struct MHD_UpgradeResponseHandle *eready_urh_head;
1307 
1311  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1312 #endif /* UPGRADE_SUPPORT */
1313 #endif /* EPOLL_SUPPORT */
1314 
1330 
1337 
1345 
1352 
1358 
1362  void *apc_cls;
1363 
1369 
1374 
1380 
1385 
1394 
1399 
1404 
1409 
1410 #ifdef HAVE_MESSAGES
1411 
1415  void (*custom_error_log) (void *cls, const char *fmt, va_list va);
1416 
1420  void *custom_error_log_cls;
1421 #endif
1422 
1426  struct MHD_Daemon *master;
1427 
1428 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1429 
1432  struct MHD_Daemon *worker_pool;
1433 #endif
1434 
1439 
1443  size_t pool_size;
1444 
1449 
1450 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1451 
1454  size_t thread_stack_size;
1455 
1459  unsigned int worker_pool_size;
1460 
1464  MHD_thread_handle_ID_ pid;
1465 
1469  MHD_mutex_ per_ip_connection_mutex;
1470 
1475  MHD_mutex_ cleanup_connection_mutex;
1476 #endif
1477 
1482 
1493 
1494 #ifdef EPOLL_SUPPORT
1495 
1498  int epoll_fd;
1499 
1504  bool listen_socket_in_epoll;
1505 
1506 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
1507 
1511  int epoll_upgrade_fd;
1512 
1517  bool upgrade_fd_in_epoll;
1518 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
1519 
1520 #endif
1521 
1526  struct MHD_itc_ itc;
1527 
1531  volatile bool shutdown;
1532 
1538  volatile bool was_quiesced;
1539 
1547  bool at_limit;
1548 
1549  /*
1550  * Do we need to process resuming connections?
1551  */
1552  bool resuming;
1553 
1563  bool data_already_pending;
1564 
1568  unsigned int connections;
1569 
1573  unsigned int connection_limit;
1574 
1580 
1586 
1591 
1595  uint16_t port;
1596 
1601 
1602 #ifdef HTTPS_SUPPORT
1603 #ifdef UPGRADE_SUPPORT
1604 
1609  struct MHD_UpgradeResponseHandle *urh_head;
1610 
1616  struct MHD_UpgradeResponseHandle *urh_tail;
1617 #endif /* UPGRADE_SUPPORT */
1618 
1622  gnutls_priority_t priority_cache;
1623 
1628  gnutls_credentials_type_t cred_type;
1629 
1633  gnutls_certificate_credentials_t x509_cred;
1634 
1638  gnutls_dh_params_t dh_params;
1639 
1643  gnutls_psk_server_credentials_t psk_cred;
1644 
1645 #if GNUTLS_VERSION_MAJOR >= 3
1646 
1650  gnutls_certificate_retrieve_function2 *cert_callback;
1651 
1655  MHD_PskServerCredentialsCallback cred_callback;
1656 
1660  void *cred_callback_cls;
1661 #endif
1662 
1666  const char *https_mem_key;
1667 
1671  const char *https_mem_cert;
1672 
1676  const char *https_key_password;
1677 
1681  const char *https_mem_trust;
1682 
1686  gnutls_dh_params_t https_mem_dhparams;
1687 
1691  bool have_dhparams;
1692 
1693 #endif /* HTTPS_SUPPORT */
1694 
1695 #ifdef DAUTH_SUPPORT
1696 
1700  const char *digest_auth_random;
1701 
1705  struct MHD_NonceNc *nnc;
1706 
1707 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1708 
1711  MHD_mutex_ nnc_lock;
1712 #endif
1713 
1717  size_t digest_auth_rand_size;
1718 
1722  unsigned int nonce_nc_size;
1723 
1724 #endif
1725 
1726 #ifdef TCP_FASTOPEN
1727 
1730  unsigned int fastopen_queue_size;
1731 #endif
1732 
1736  unsigned int listen_backlog_size;
1737 };
1738 
1739 
1748 #define DLL_insert(head,tail,element) do { \
1749  mhd_assert (NULL == (element)->next); \
1750  mhd_assert (NULL == (element)->prev); \
1751  (element)->next = (head); \
1752  (element)->prev = NULL; \
1753  if ((tail) == NULL) \
1754  (tail) = element; \
1755  else \
1756  (head)->prev = element; \
1757  (head) = (element); } while (0)
1758 
1759 
1769 #define DLL_remove(head,tail,element) do { \
1770  mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \
1771  mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \
1772  if ((element)->prev == NULL) \
1773  (head) = (element)->next; \
1774  else \
1775  (element)->prev->next = (element)->next; \
1776  if ((element)->next == NULL) \
1777  (tail) = (element)->prev; \
1778  else \
1779  (element)->next->prev = (element)->prev; \
1780  (element)->next = NULL; \
1781  (element)->prev = NULL; } while (0)
1782 
1783 
1784 
1793 #define XDLL_insert(head,tail,element) do { \
1794  mhd_assert (NULL == (element)->nextX); \
1795  mhd_assert (NULL == (element)->prevX); \
1796  (element)->nextX = (head); \
1797  (element)->prevX = NULL; \
1798  if (NULL == (tail)) \
1799  (tail) = element; \
1800  else \
1801  (head)->prevX = element; \
1802  (head) = (element); } while (0)
1803 
1804 
1814 #define XDLL_remove(head,tail,element) do { \
1815  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1816  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1817  if (NULL == (element)->prevX) \
1818  (head) = (element)->nextX; \
1819  else \
1820  (element)->prevX->nextX = (element)->nextX; \
1821  if (NULL == (element)->nextX) \
1822  (tail) = (element)->prevX; \
1823  else \
1824  (element)->nextX->prevX = (element)->prevX; \
1825  (element)->nextX = NULL; \
1826  (element)->prevX = NULL; } while (0)
1827 
1828 
1837 #define EDLL_insert(head,tail,element) do { \
1838  (element)->nextE = (head); \
1839  (element)->prevE = NULL; \
1840  if ((tail) == NULL) \
1841  (tail) = element; \
1842  else \
1843  (head)->prevE = element; \
1844  (head) = (element); } while (0)
1845 
1846 
1856 #define EDLL_remove(head,tail,element) do { \
1857  if ((element)->prevE == NULL) \
1858  (head) = (element)->nextE; \
1859  else \
1860  (element)->prevE->nextE = (element)->nextE; \
1861  if ((element)->nextE == NULL) \
1862  (tail) = (element)->prevE; \
1863  else \
1864  (element)->nextE->prevE = (element)->prevE; \
1865  (element)->nextE = NULL; \
1866  (element)->prevE = NULL; } while (0)
1867 
1868 
1874 void
1875 MHD_unescape_plus (char *arg);
1876 
1877 
1889 typedef int
1891  const char *key,
1892  const char *value,
1893  enum MHD_ValueKind kind);
1894 
1895 
1910 int
1911 MHD_parse_arguments_ (struct MHD_Connection *connection,
1912  enum MHD_ValueKind kind,
1913  char *args,
1915  unsigned int *num_headers);
1916 
1917 
1931 bool
1933  const char *key,
1934  const char *token,
1935  size_t token_len);
1936 
1948 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1949  MHD_check_response_header_token_ci((r),(k),(tkn),MHD_STATICSTR_LEN_(tkn))
1950 
1951 
1961 void
1962 internal_suspend_connection_ (struct MHD_Connection *connection);
1963 
1964 #endif
bool thread_joined
Definition: internal.h:776
unsigned int per_ip_connection_limit
Definition: internal.h:1585
void * unescape_callback_cls
Definition: internal.h:1408
uint64_t total_size
Definition: internal.h:1639
bool have_chunked_upload
Definition: internal.h:935
additional automatic macros for MHD_config.h
uint64_t fd_off
Definition: internal.h:1650
uint64_t current_chunk_offset
Definition: internal.h:949
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:915
uint64_t response_write_position
Definition: internal.h:809
public interface to libmicrohttpd
enum MHD_ConnKeepAlive keepalive
Definition: internal.h:716
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:920
struct MHD_Connection * prevX
Definition: internal.h:667
MHD_thread_handle_ID_ pid
Definition: internal.h:1246
time_t connection_timeout
Definition: internal.h:1579
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:407
char * version
Definition: internal.h:709
int suspended_dummy
Definition: internal.h:1008
struct MHD_Response * response
Definition: internal.h:665
char * data
Definition: internal.h:1585
char * colon
Definition: internal.h:746
char * write_buffer
Definition: internal.h:729
volatile bool was_quiesced
Definition: internal.h:1538
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:1222
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:1254
int MHD_socket
Definition: microhttpd.h:181
uint64_t remaining_upload_size
Definition: internal.h:802
unsigned int responseCode
Definition: internal.h:926
platform-specific includes for libmicrohttpd
char * header
Definition: internal.h:344
void * uri_log_callback_cls
Definition: internal.h:1398
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:796
Types for platform-independent inter-thread communication.
int listening_address_reuse
Definition: internal.h:1492
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1256
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1379
struct MHD_Connection * next
Definition: internal.h:648
bool client_aware
Definition: internal.h:852
int strict_for_client
Definition: internal.h:1600
void * socket_context
Definition: internal.h:691
struct MHD_HTTP_Header * first_header
Definition: internal.h:1579
uint64_t nmask
Definition: internal.h:237
size_t data_buffer_size
Definition: internal.h:1661
size_t write_buffer_send_offset
Definition: internal.h:784
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:768
bool sk_tcp_cork_nopush_on
Definition: internal.h:876
macros for mhd_assert()
void * client_context
Definition: internal.h:683
const char * url
Definition: internal.h:703
size_t continue_message_write_offset
Definition: internal.h:823
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:697
unsigned int connection_limit
Definition: internal.h:1573
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:1590
struct MHD_Connection * connections_head
Definition: internal.h:1152
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2686
LogCallback uri_log_callback
Definition: internal.h:1393
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2084
bool in_cleanup
Definition: internal.h:903
unsigned int reference_count
Definition: internal.h:1672
time_t connection_timeout
Definition: internal.h:742
bool sk_tcp_nodelay_on
Definition: internal.h:870
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:1595
char * last
Definition: internal.h:737
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:723
MHD_EpollState
Definition: internal.h:584
ReceiveCallback recv_cls
Definition: internal.h:703
size_t write_buffer_size
Definition: internal.h:779
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:1403
unsigned int listen_backlog_size
Definition: internal.h:1736
unsigned int connection_timeout_dummy
Definition: internal.h:845
struct MHD_Connection * suspended_connections_tail
Definition: internal.h:1169
size_t pool_size
Definition: internal.h:1443
bool tls_read_ready
Definition: internal.h:766
struct MHD_itc_ itc
Definition: internal.h:1407
MHD_AcceptPolicyCallback apc
Definition: internal.h:1357
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:387
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:1985
size_t write_buffer_append_offset
Definition: internal.h:790
MHD_ConnKeepAlive
Definition: internal.h:151
struct MHD_Connection * normal_timeout_tail
Definition: internal.h:1132
MHD_RequestCompletedCallback notify_completed
Definition: internal.h:1368
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:1373
MHD_socket listen_fd
Definition: internal.h:1481
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:1236
void * notify_connection_cls
Definition: internal.h:1384
void * apc_cls
Definition: internal.h:1362
MHD_ContentReaderCallback crc
Definition: internal.h:1597
bool at_limit
Definition: internal.h:1480
struct sockaddr * addr
Definition: internal.h:752
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:774
void * default_handler_cls
Definition: internal.h:1259
volatile bool shutdown
Definition: internal.h:1523
MHD_ResponseFlags
Definition: microhttpd.h:2615
MHD_TLS_CONN_STATE
Definition: internal.h:528
MHD_mutex_ cleanup_connection_mutex
Definition: internal.h:1262
uint64_t current_chunk_size
Definition: internal.h:943
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:655
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:888
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:660
size_t pool_increment
Definition: internal.h:1448
void MHD_unescape_plus(char *arg)
Definition: internal.c:119