GNU libmicrohttpd  0.9.70
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 
969 
970 #ifdef UPGRADE_SUPPORT
971 
977  struct MHD_UpgradeResponseHandle *urh;
978 #endif /* UPGRADE_SUPPORT */
979 
980 #ifdef HTTPS_SUPPORT
981 
985  gnutls_session_t tls_session;
986 
990  int protocol;
991 
995  int cipher;
996 
1000  enum MHD_TLS_CONN_STATE tls_state;
1001 
1006  bool tls_read_ready;
1007 #endif /* HTTPS_SUPPORT */
1008 
1012  bool suspended;
1013 
1018 
1022  bool resuming;
1023 };
1024 
1025 
1026 #ifdef UPGRADE_SUPPORT
1027 
1036 #define RESERVE_EBUF_SIZE 8
1037 
1044 struct UpgradeEpollHandle
1045 {
1050  struct MHD_UpgradeResponseHandle *urh;
1051 
1067  MHD_socket socket;
1068 
1072  enum MHD_EpollState celi;
1073 
1074 };
1075 
1076 
1082 struct MHD_UpgradeResponseHandle
1083 {
1089  struct MHD_Connection *connection;
1090 
1091 #ifdef HTTPS_SUPPORT
1092 
1095  struct MHD_UpgradeResponseHandle *next;
1096 
1100  struct MHD_UpgradeResponseHandle *prev;
1101 
1102 #ifdef EPOLL_SUPPORT
1103 
1106  struct MHD_UpgradeResponseHandle *nextE;
1107 
1111  struct MHD_UpgradeResponseHandle *prevE;
1112 
1116  bool in_eready_list;
1117 #endif
1118 
1124  char *in_buffer;
1125 
1131  char *out_buffer;
1132 
1138  size_t in_buffer_size;
1139 
1145  size_t out_buffer_size;
1146 
1154  size_t in_buffer_used;
1155 
1163  size_t out_buffer_used;
1164 
1168  struct UpgradeEpollHandle app;
1169 
1174  struct UpgradeEpollHandle mhd;
1175 
1180  char e_buf[RESERVE_EBUF_SIZE];
1181 
1182 #endif /* HTTPS_SUPPORT */
1183 
1194  volatile bool was_closed;
1195 
1217  bool clean_ready;
1218 };
1219 #endif /* UPGRADE_SUPPORT */
1220 
1221 
1230 typedef void *
1231 (*LogCallback)(void *cls,
1232  const char *uri,
1233  struct MHD_Connection *con);
1234 
1244 typedef size_t
1245 (*UnescapeCallback)(void *cls,
1246  struct MHD_Connection *conn,
1247  char *uri);
1248 
1249 
1257 struct MHD_Daemon
1258 {
1259 
1264 
1269 
1274 
1279 
1284 
1289 
1293  struct MHD_Connection *cleanup_head;
1294 
1298  struct MHD_Connection *cleanup_tail;
1299 
1300 #ifdef EPOLL_SUPPORT
1301 
1304  struct MHD_Connection *eready_head;
1305 
1309  struct MHD_Connection *eready_tail;
1310 
1311 #ifdef UPGRADE_SUPPORT
1312 
1315  struct MHD_UpgradeResponseHandle *eready_urh_head;
1316 
1320  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1321 #endif /* UPGRADE_SUPPORT */
1322 #endif /* EPOLL_SUPPORT */
1323 
1339 
1346 
1354 
1361 
1367 
1371  void *apc_cls;
1372 
1378 
1383 
1389 
1394 
1403 
1408 
1413 
1418 
1419 #ifdef HAVE_MESSAGES
1420 
1424  MHD_LogCallback custom_error_log;
1425 
1429  void *custom_error_log_cls;
1430 #endif
1431 
1435  struct MHD_Daemon *master;
1436 
1437 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1438 
1441  struct MHD_Daemon *worker_pool;
1442 #endif
1443 
1448 
1452  size_t pool_size;
1453 
1458 
1459 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1460 
1463  size_t thread_stack_size;
1464 
1469  enum MHD_DisableSanityCheck insanity_level;
1470 
1474  unsigned int worker_pool_size;
1475 
1479  MHD_thread_handle_ID_ pid;
1480 
1484  MHD_mutex_ per_ip_connection_mutex;
1485 
1490  MHD_mutex_ cleanup_connection_mutex;
1491 #endif
1492 
1497 
1508 
1509 #ifdef EPOLL_SUPPORT
1510 
1513  int epoll_fd;
1514 
1519  bool listen_socket_in_epoll;
1520 
1521 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
1522 
1526  int epoll_upgrade_fd;
1527 
1532  bool upgrade_fd_in_epoll;
1533 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
1534 
1535 #endif
1536 
1541  struct MHD_itc_ itc;
1542 
1546  volatile bool shutdown;
1547 
1553  volatile bool was_quiesced;
1554 
1562  bool at_limit;
1563 
1564  /*
1565  * Do we need to process resuming connections?
1566  */
1567  bool resuming;
1568 
1578  bool data_already_pending;
1579 
1583  unsigned int connections;
1584 
1588  unsigned int connection_limit;
1589 
1595 
1601 
1606 
1610  uint16_t port;
1611 
1616 
1617 #ifdef HTTPS_SUPPORT
1618 #ifdef UPGRADE_SUPPORT
1619 
1624  struct MHD_UpgradeResponseHandle *urh_head;
1625 
1631  struct MHD_UpgradeResponseHandle *urh_tail;
1632 #endif /* UPGRADE_SUPPORT */
1633 
1637  gnutls_priority_t priority_cache;
1638 
1643  gnutls_credentials_type_t cred_type;
1644 
1648  gnutls_certificate_credentials_t x509_cred;
1649 
1653  gnutls_dh_params_t dh_params;
1654 
1658  gnutls_psk_server_credentials_t psk_cred;
1659 
1660 #if GNUTLS_VERSION_MAJOR >= 3
1661 
1665  gnutls_certificate_retrieve_function2 *cert_callback;
1666 
1670  MHD_PskServerCredentialsCallback cred_callback;
1671 
1675  void *cred_callback_cls;
1676 #endif
1677 
1678 #if GNUTLS_VERSION_NUMBER >= 0x030603
1679 
1683  gnutls_certificate_retrieve_function3 *cert_callback2;
1684 #endif
1685 
1689  const char *https_mem_key;
1690 
1694  const char *https_mem_cert;
1695 
1699  const char *https_key_password;
1700 
1704  const char *https_mem_trust;
1705 
1709  gnutls_dh_params_t https_mem_dhparams;
1710 
1714  bool have_dhparams;
1715 
1716 #endif /* HTTPS_SUPPORT */
1717 
1718 #ifdef DAUTH_SUPPORT
1719 
1723  const char *digest_auth_random;
1724 
1728  struct MHD_NonceNc *nnc;
1729 
1730 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1731 
1734  MHD_mutex_ nnc_lock;
1735 #endif
1736 
1740  size_t digest_auth_rand_size;
1741 
1745  unsigned int nonce_nc_size;
1746 
1747 #endif
1748 
1749 #ifdef TCP_FASTOPEN
1750 
1753  unsigned int fastopen_queue_size;
1754 #endif
1755 
1759  unsigned int listen_backlog_size;
1760 };
1761 
1762 
1771 #define DLL_insert(head,tail,element) do { \
1772  mhd_assert (NULL == (element)->next); \
1773  mhd_assert (NULL == (element)->prev); \
1774  (element)->next = (head); \
1775  (element)->prev = NULL; \
1776  if ((tail) == NULL) \
1777  (tail) = element; \
1778  else \
1779  (head)->prev = element; \
1780  (head) = (element); } while (0)
1781 
1782 
1792 #define DLL_remove(head,tail,element) do { \
1793  mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \
1794  mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \
1795  if ((element)->prev == NULL) \
1796  (head) = (element)->next; \
1797  else \
1798  (element)->prev->next = (element)->next; \
1799  if ((element)->next == NULL) \
1800  (tail) = (element)->prev; \
1801  else \
1802  (element)->next->prev = (element)->prev; \
1803  (element)->next = NULL; \
1804  (element)->prev = NULL; } while (0)
1805 
1806 
1815 #define XDLL_insert(head,tail,element) do { \
1816  mhd_assert (NULL == (element)->nextX); \
1817  mhd_assert (NULL == (element)->prevX); \
1818  (element)->nextX = (head); \
1819  (element)->prevX = NULL; \
1820  if (NULL == (tail)) \
1821  (tail) = element; \
1822  else \
1823  (head)->prevX = element; \
1824  (head) = (element); } while (0)
1825 
1826 
1836 #define XDLL_remove(head,tail,element) do { \
1837  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1838  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1839  if (NULL == (element)->prevX) \
1840  (head) = (element)->nextX; \
1841  else \
1842  (element)->prevX->nextX = (element)->nextX; \
1843  if (NULL == (element)->nextX) \
1844  (tail) = (element)->prevX; \
1845  else \
1846  (element)->nextX->prevX = (element)->prevX; \
1847  (element)->nextX = NULL; \
1848  (element)->prevX = NULL; } while (0)
1849 
1850 
1859 #define EDLL_insert(head,tail,element) do { \
1860  (element)->nextE = (head); \
1861  (element)->prevE = NULL; \
1862  if ((tail) == NULL) \
1863  (tail) = element; \
1864  else \
1865  (head)->prevE = element; \
1866  (head) = (element); } while (0)
1867 
1868 
1878 #define EDLL_remove(head,tail,element) do { \
1879  if ((element)->prevE == NULL) \
1880  (head) = (element)->nextE; \
1881  else \
1882  (element)->prevE->nextE = (element)->nextE; \
1883  if ((element)->nextE == NULL) \
1884  (tail) = (element)->prevE; \
1885  else \
1886  (element)->nextE->prevE = (element)->prevE; \
1887  (element)->nextE = NULL; \
1888  (element)->prevE = NULL; } while (0)
1889 
1890 
1896 void
1897 MHD_unescape_plus (char *arg);
1898 
1899 
1913 typedef int
1915  const char *key,
1916  size_t key_size,
1917  const char *value,
1918  size_t value_size,
1919  enum MHD_ValueKind kind);
1920 
1921 
1936 int
1937 MHD_parse_arguments_ (struct MHD_Connection *connection,
1938  enum MHD_ValueKind kind,
1939  char *args,
1941  unsigned int *num_headers);
1942 
1943 
1960 bool
1962  const char *key,
1963  size_t key_len,
1964  const char *token,
1965  size_t token_len);
1966 
1978 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1979  MHD_check_response_header_token_ci ((r),(k),MHD_STATICSTR_LEN_ (k), \
1980  (tkn),MHD_STATICSTR_LEN_ (tkn))
1981 
1982 
1992 void
1993 internal_suspend_connection_ (struct MHD_Connection *connection);
1994 
1995 #endif
bool thread_joined
Definition: internal.h:779
unsigned int per_ip_connection_limit
Definition: internal.h:1600
void * unescape_callback_cls
Definition: internal.h:1417
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:1347
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:1594
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1606
MHD_PanicCallback mhd_panic
Definition: panic.c:31
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2331
MHD_CONNECTION_STATE
Definition: internal.h:421
char * version
Definition: internal.h:724
int suspended_dummy
Definition: internal.h:1017
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:1553
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:1231
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:1263
int MHD_socket
Definition: microhttpd.h:187
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:1407
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:2107
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:1329
int listening_address_reuse
Definition: internal.h:1507
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1259
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1388
struct MHD_Connection * next
Definition: internal.h:651
bool client_aware
Definition: internal.h:867
int strict_for_client
Definition: internal.h:1615
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
struct MHD_Daemon * worker_pool
Definition: internal.h:1073
MHD_DisableSanityCheck
Definition: microhttpd.h:1716
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:1588
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:1605
struct MHD_Connection * connections_head
Definition: internal.h:1155
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2809
LogCallback uri_log_callback
Definition: internal.h:1402
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2315
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:1610
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:1757
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
UnescapeCallback unescape_callback
Definition: internal.h:1412
size_t header_size
Definition: internal.h:280
unsigned int listen_backlog_size
Definition: internal.h:1759
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:1452
bool tls_read_ready
Definition: internal.h:769
struct MHD_itc_ itc
Definition: internal.h:1410
MHD_AcceptPolicyCallback apc
Definition: internal.h:1366
time_t last_activity
Definition: internal.h:739
struct MHD_Connection * cleanup_tail
Definition: internal.h:1182
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:2166
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:2189
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:1377
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:3295
bool resuming
Definition: internal.h:1510
bool read_closed
Definition: internal.h:792
void * notify_completed_cls
Definition: internal.h:1382
MHD_socket listen_fd
Definition: internal.h:1496
struct MemoryPool * pool
Definition: internal.h:685
TransmitCallback send_cls
Definition: internal.h:711
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:1245
void * notify_connection_cls
Definition: internal.h:1393
void * apc_cls
Definition: internal.h:1371
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:1268
volatile bool shutdown
Definition: internal.h:1526
MHD_ResponseFlags
Definition: microhttpd.h:2927
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
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2121
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2215
struct MHD_HTTP_Header * headers_received
Definition: internal.h:670
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1029
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:675
size_t pool_increment
Definition: internal.h:1457
void MHD_unescape_plus(char *arg)
Definition: internal.c:123