GNU libmicrohttpd  0.9.68
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 #endif
259 
260 
264 struct MHD_HTTP_Header
265 {
269  struct MHD_HTTP_Header *next;
270 
274  char *header;
275 
279  size_t header_size;
280 
284  char *value;
285 
289  size_t value_size;
290 
295  enum MHD_ValueKind kind;
296 
297 };
298 
299 
303 struct MHD_Response
304 {
305 
312 
317  char *data;
318 
323  void *crc_cls;
324 
330 
336 
337 #ifdef UPGRADE_SUPPORT
338 
343  MHD_UpgradeHandler upgrade_handler;
344 
348  void *upgrade_handler_cls;
349 #endif /* UPGRADE_SUPPORT */
350 
351 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
352 
356  MHD_mutex_ mutex;
357 #endif
358 
362  uint64_t total_size;
363 
368  uint64_t data_start;
369 
373  uint64_t fd_off;
374 
379  size_t data_size;
380 
384  size_t data_buffer_size;
385 
390  unsigned int reference_count;
391 
395  int fd;
396 
401 
402 };
403 
404 
421 {
427 
432 
437 
442 
447 
452 
457 
462 
468 
474 
480 
485 
490 
496 
501 
506 
511 
516 
521 
526 
527 #ifdef UPGRADE_SUPPORT
528 
532  MHD_CONNECTION_UPGRADE
533 #endif /* UPGRADE_SUPPORT */
534 
535 };
536 
537 
542 {
553 };
554 
558 #define DEBUG_STATES MHD_NO
559 
560 
561 #ifdef HAVE_MESSAGES
562 #if DEBUG_STATES
563 const char *
564 MHD_state_to_string (enum MHD_CONNECTION_STATE state);
565 #endif
566 #endif
567 
576 typedef ssize_t
578  void *write_to,
579  size_t max_bytes);
580 
581 
590 typedef ssize_t
592  const void *read_from,
593  size_t max_bytes);
594 
595 
600 {
605 
610 
615 };
616 
617 
621 struct MHD_Connection
622 {
623 
624 #ifdef EPOLL_SUPPORT
625 
628  struct MHD_Connection *nextE;
629 
633  struct MHD_Connection *prevE;
634 #endif
635 
639  struct MHD_Connection *next;
640 
644  struct MHD_Connection *prev;
645 
653  struct MHD_Connection *nextX;
654 
658  struct MHD_Connection *prevX;
659 
663  struct MHD_Daemon *daemon;
664 
669 
674 
679 
688  struct MemoryPool *pool;
689 
697 
705  void *socket_context;
706 
710  char *method;
711 
716  const char *url;
717 
722  char *version;
723 
730 
736  char *read_buffer;
737 
743 
750  char *last;
751 
759  char *colon;
760 
765  struct sockaddr *addr;
766 
767 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
768 
772  MHD_thread_handle_ID_ pid;
773 #endif
774 
782 
788 
793 
798 
804 
809  size_t header_size;
810 
816 
823 
824 #if defined(_MHD_HAVE_SENDFILE)
825  enum MHD_resp_sender_
826  {
827  MHD_resp_sender_std = 0,
828  MHD_resp_sender_sendfile
829  } resp_sender;
830 #endif /* _MHD_HAVE_SENDFILE */
831 
837 
841  socklen_t addr_len;
842 
847  time_t last_activity;
848 
853  time_t connection_timeout;
854 
859 
866 
873 
877  bool sk_nonblck;
878 
884 
891  bool read_closed;
892 
893 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
894 
897  bool thread_joined;
898 #endif
899 
904  bool in_idle;
905 
911 
912 #ifdef EPOLL_SUPPORT
913 
916  enum MHD_EpollState epoll_state;
917 #endif
918 
923 
928 
933  unsigned int responseCode;
934 
943 
951 
957 
962 
967 
968 #ifdef UPGRADE_SUPPORT
969 
975  struct MHD_UpgradeResponseHandle *urh;
976 #endif /* UPGRADE_SUPPORT */
977 
978 #ifdef HTTPS_SUPPORT
979 
983  gnutls_session_t tls_session;
984 
988  int protocol;
989 
993  int cipher;
994 
998  enum MHD_TLS_CONN_STATE tls_state;
999 
1004  bool tls_read_ready;
1005 #endif /* HTTPS_SUPPORT */
1006 
1010  bool suspended;
1011 
1016 
1020  bool resuming;
1021 };
1022 
1023 
1024 #ifdef UPGRADE_SUPPORT
1025 
1034 #define RESERVE_EBUF_SIZE 8
1035 
1042 struct UpgradeEpollHandle
1043 {
1048  struct MHD_UpgradeResponseHandle *urh;
1049 
1065  MHD_socket socket;
1066 
1070  enum MHD_EpollState celi;
1071 
1072 };
1073 
1074 
1080 struct MHD_UpgradeResponseHandle
1081 {
1087  struct MHD_Connection *connection;
1088 
1089 #ifdef HTTPS_SUPPORT
1090 
1093  struct MHD_UpgradeResponseHandle *next;
1094 
1098  struct MHD_UpgradeResponseHandle *prev;
1099 
1100 #ifdef EPOLL_SUPPORT
1101 
1104  struct MHD_UpgradeResponseHandle *nextE;
1105 
1109  struct MHD_UpgradeResponseHandle *prevE;
1110 
1114  bool in_eready_list;
1115 #endif
1116 
1122  char *in_buffer;
1123 
1129  char *out_buffer;
1130 
1136  size_t in_buffer_size;
1137 
1143  size_t out_buffer_size;
1144 
1152  size_t in_buffer_used;
1153 
1161  size_t out_buffer_used;
1162 
1166  struct UpgradeEpollHandle app;
1167 
1172  struct UpgradeEpollHandle mhd;
1173 
1178  char e_buf[RESERVE_EBUF_SIZE];
1179 
1180 #endif /* HTTPS_SUPPORT */
1181 
1192  volatile bool was_closed;
1193 
1215  bool clean_ready;
1216 };
1217 #endif /* UPGRADE_SUPPORT */
1218 
1219 
1228 typedef void *
1229 (*LogCallback)(void *cls,
1230  const char *uri,
1231  struct MHD_Connection *con);
1232 
1242 typedef size_t
1243 (*UnescapeCallback)(void *cls,
1244  struct MHD_Connection *conn,
1245  char *uri);
1246 
1247 
1255 struct MHD_Daemon
1256 {
1257 
1262 
1267 
1272 
1277 
1282 
1287 
1291  struct MHD_Connection *cleanup_head;
1292 
1296  struct MHD_Connection *cleanup_tail;
1297 
1298 #ifdef EPOLL_SUPPORT
1299 
1302  struct MHD_Connection *eready_head;
1303 
1307  struct MHD_Connection *eready_tail;
1308 
1309 #ifdef UPGRADE_SUPPORT
1310 
1313  struct MHD_UpgradeResponseHandle *eready_urh_head;
1314 
1318  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1319 #endif /* UPGRADE_SUPPORT */
1320 #endif /* EPOLL_SUPPORT */
1321 
1337 
1344 
1352 
1359 
1365 
1369  void *apc_cls;
1370 
1376 
1381 
1387 
1392 
1401 
1406 
1411 
1416 
1417 #ifdef HAVE_MESSAGES
1418 
1422  MHD_LogCallback custom_error_log;
1423 
1427  void *custom_error_log_cls;
1428 #endif
1429 
1433  struct MHD_Daemon *master;
1434 
1435 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1436 
1439  struct MHD_Daemon *worker_pool;
1440 #endif
1441 
1446 
1450  size_t pool_size;
1451 
1456 
1457 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1458 
1461  size_t thread_stack_size;
1462 
1467  enum MHD_DisableSanityCheck insanity_level;
1468 
1472  unsigned int worker_pool_size;
1473 
1477  MHD_thread_handle_ID_ pid;
1478 
1482  MHD_mutex_ per_ip_connection_mutex;
1483 
1488  MHD_mutex_ cleanup_connection_mutex;
1489 #endif
1490 
1495 
1506 
1507 #ifdef EPOLL_SUPPORT
1508 
1511  int epoll_fd;
1512 
1517  bool listen_socket_in_epoll;
1518 
1519 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
1520 
1524  int epoll_upgrade_fd;
1525 
1530  bool upgrade_fd_in_epoll;
1531 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
1532 
1533 #endif
1534 
1539  struct MHD_itc_ itc;
1540 
1544  volatile bool shutdown;
1545 
1551  volatile bool was_quiesced;
1552 
1560  bool at_limit;
1561 
1562  /*
1563  * Do we need to process resuming connections?
1564  */
1565  bool resuming;
1566 
1576  bool data_already_pending;
1577 
1581  unsigned int connections;
1582 
1586  unsigned int connection_limit;
1587 
1593 
1599 
1604 
1608  uint16_t port;
1609 
1614 
1615 #ifdef HTTPS_SUPPORT
1616 #ifdef UPGRADE_SUPPORT
1617 
1622  struct MHD_UpgradeResponseHandle *urh_head;
1623 
1629  struct MHD_UpgradeResponseHandle *urh_tail;
1630 #endif /* UPGRADE_SUPPORT */
1631 
1635  gnutls_priority_t priority_cache;
1636 
1641  gnutls_credentials_type_t cred_type;
1642 
1646  gnutls_certificate_credentials_t x509_cred;
1647 
1651  gnutls_dh_params_t dh_params;
1652 
1656  gnutls_psk_server_credentials_t psk_cred;
1657 
1658 #if GNUTLS_VERSION_MAJOR >= 3
1659 
1663  gnutls_certificate_retrieve_function2 *cert_callback;
1664 
1668  MHD_PskServerCredentialsCallback cred_callback;
1669 
1673  void *cred_callback_cls;
1674 #endif
1675 
1676 #if GNUTLS_VERSION_NUMBER >= 0x030603
1677 
1681  gnutls_certificate_retrieve_function3 *cert_callback2;
1682 #endif
1683 
1687  const char *https_mem_key;
1688 
1692  const char *https_mem_cert;
1693 
1697  const char *https_key_password;
1698 
1702  const char *https_mem_trust;
1703 
1707  gnutls_dh_params_t https_mem_dhparams;
1708 
1712  bool have_dhparams;
1713 
1714 #endif /* HTTPS_SUPPORT */
1715 
1716 #ifdef DAUTH_SUPPORT
1717 
1721  const char *digest_auth_random;
1722 
1726  struct MHD_NonceNc *nnc;
1727 
1728 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1729 
1732  MHD_mutex_ nnc_lock;
1733 #endif
1734 
1738  size_t digest_auth_rand_size;
1739 
1743  unsigned int nonce_nc_size;
1744 
1745 #endif
1746 
1747 #ifdef TCP_FASTOPEN
1748 
1751  unsigned int fastopen_queue_size;
1752 #endif
1753 
1757  unsigned int listen_backlog_size;
1758 };
1759 
1760 
1769 #define DLL_insert(head,tail,element) do { \
1770  mhd_assert (NULL == (element)->next); \
1771  mhd_assert (NULL == (element)->prev); \
1772  (element)->next = (head); \
1773  (element)->prev = NULL; \
1774  if ((tail) == NULL) \
1775  (tail) = element; \
1776  else \
1777  (head)->prev = element; \
1778  (head) = (element); } while (0)
1779 
1780 
1790 #define DLL_remove(head,tail,element) do { \
1791  mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \
1792  mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \
1793  if ((element)->prev == NULL) \
1794  (head) = (element)->next; \
1795  else \
1796  (element)->prev->next = (element)->next; \
1797  if ((element)->next == NULL) \
1798  (tail) = (element)->prev; \
1799  else \
1800  (element)->next->prev = (element)->prev; \
1801  (element)->next = NULL; \
1802  (element)->prev = NULL; } while (0)
1803 
1804 
1805 
1814 #define XDLL_insert(head,tail,element) do { \
1815  mhd_assert (NULL == (element)->nextX); \
1816  mhd_assert (NULL == (element)->prevX); \
1817  (element)->nextX = (head); \
1818  (element)->prevX = NULL; \
1819  if (NULL == (tail)) \
1820  (tail) = element; \
1821  else \
1822  (head)->prevX = element; \
1823  (head) = (element); } while (0)
1824 
1825 
1835 #define XDLL_remove(head,tail,element) do { \
1836  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1837  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1838  if (NULL == (element)->prevX) \
1839  (head) = (element)->nextX; \
1840  else \
1841  (element)->prevX->nextX = (element)->nextX; \
1842  if (NULL == (element)->nextX) \
1843  (tail) = (element)->prevX; \
1844  else \
1845  (element)->nextX->prevX = (element)->prevX; \
1846  (element)->nextX = NULL; \
1847  (element)->prevX = NULL; } while (0)
1848 
1849 
1858 #define EDLL_insert(head,tail,element) do { \
1859  (element)->nextE = (head); \
1860  (element)->prevE = NULL; \
1861  if ((tail) == NULL) \
1862  (tail) = element; \
1863  else \
1864  (head)->prevE = element; \
1865  (head) = (element); } while (0)
1866 
1867 
1877 #define EDLL_remove(head,tail,element) do { \
1878  if ((element)->prevE == NULL) \
1879  (head) = (element)->nextE; \
1880  else \
1881  (element)->prevE->nextE = (element)->nextE; \
1882  if ((element)->nextE == NULL) \
1883  (tail) = (element)->prevE; \
1884  else \
1885  (element)->nextE->prevE = (element)->prevE; \
1886  (element)->nextE = NULL; \
1887  (element)->prevE = NULL; } while (0)
1888 
1889 
1895 void
1896 MHD_unescape_plus (char *arg);
1897 
1898 
1912 typedef int
1914  const char *key,
1915  size_t key_size,
1916  const char *value,
1917  size_t value_size,
1918  enum MHD_ValueKind kind);
1919 
1920 
1935 int
1936 MHD_parse_arguments_ (struct MHD_Connection *connection,
1937  enum MHD_ValueKind kind,
1938  char *args,
1940  unsigned int *num_headers);
1941 
1942 
1959 bool
1961  const char *key,
1962  size_t key_len,
1963  const char *token,
1964  size_t token_len);
1965 
1977 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1978  MHD_check_response_header_token_ci ((r),(k),MHD_STATICSTR_LEN_ (k), \
1979  (tkn),MHD_STATICSTR_LEN_ (tkn))
1980 
1981 
1991 void
1992 internal_suspend_connection_ (struct MHD_Connection *connection);
1993 
1994 #endif
bool thread_joined
Definition: internal.h:779
unsigned int per_ip_connection_limit
Definition: internal.h:1598
void * unescape_callback_cls
Definition: internal.h:1415
uint64_t total_size
Definition: internal.h:1642
bool have_chunked_upload
Definition: internal.h:942
additional automatic macros for MHD_config.h
uint64_t fd_off
Definition: internal.h:1653
uint64_t current_chunk_offset
Definition: internal.h:956
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:922
uint64_t response_write_position
Definition: internal.h:822
public interface to libmicrohttpd
enum MHD_ConnKeepAlive keepalive
Definition: internal.h:729
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:927
struct MHD_Connection * prevX
Definition: internal.h:670
MHD_thread_handle_ID_ pid
Definition: internal.h:1249
time_t connection_timeout
Definition: internal.h:1592
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:420
char * version
Definition: internal.h:722
int suspended_dummy
Definition: internal.h:1015
struct MHD_Response * response
Definition: internal.h:678
char * data
Definition: internal.h:1588
char * colon
Definition: internal.h:759
char * write_buffer
Definition: internal.h:742
volatile bool was_quiesced
Definition: internal.h:1551
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:1229
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:1261
int MHD_socket
Definition: microhttpd.h:187
uint64_t remaining_upload_size
Definition: internal.h:815
unsigned int responseCode
Definition: internal.h:933
platform-specific includes for libmicrohttpd
char * header
Definition: internal.h:347
void * uri_log_callback_cls
Definition: internal.h:1405
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:809
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:1505
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1259
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1386
struct MHD_Connection * next
Definition: internal.h:651
bool client_aware
Definition: internal.h:865
int strict_for_client
Definition: internal.h:1613
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:797
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:781
macros for mhd_assert()
void * client_context
Definition: internal.h:696
const char * url
Definition: internal.h:716
size_t continue_message_write_offset
Definition: internal.h:836
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:186
char * method
Definition: internal.h:710
unsigned int connection_limit
Definition: internal.h:1586
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:1603
struct MHD_Connection * connections_head
Definition: internal.h:1155
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2795
LogCallback uri_log_callback
Definition: internal.h:1400
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2315
bool in_cleanup
Definition: internal.h:910
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:1608
char * last
Definition: internal.h:750
bool sk_cork_on
Definition: internal.h:883
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:736
MHD_EpollState
Definition: internal.h:587
ReceiveCallback recv_cls
Definition: internal.h:706
size_t value_size
Definition: internal.h:289
size_t write_buffer_size
Definition: internal.h:792
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:1410
size_t header_size
Definition: internal.h:279
unsigned int listen_backlog_size
Definition: internal.h:1757
unsigned int connection_timeout_dummy
Definition: internal.h:858
struct MHD_Connection * suspended_connections_tail
Definition: internal.h:1172
size_t pool_size
Definition: internal.h:1450
bool tls_read_ready
Definition: internal.h:769
struct MHD_itc_ itc
Definition: internal.h:1410
MHD_AcceptPolicyCallback apc
Definition: internal.h:1364
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:400
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:803
MHD_ConnKeepAlive
Definition: internal.h:154
struct MHD_Connection * normal_timeout_tail
Definition: internal.h:1135
MHD_RequestCompletedCallback notify_completed
Definition: internal.h:1375
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:3299
bool resuming
Definition: internal.h:1510
bool read_closed
Definition: internal.h:792
void * notify_completed_cls
Definition: internal.h:1380
MHD_socket listen_fd
Definition: internal.h:1494
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:1708
size_t(* UnescapeCallback)(void *cls, struct MHD_Connection *conn, char *uri)
Definition: internal.h:1243
void * notify_connection_cls
Definition: internal.h:1391
void * apc_cls
Definition: internal.h:1369
MHD_ContentReaderCallback crc
Definition: internal.h:1600
bool at_limit
Definition: internal.h:1483
struct sockaddr * addr
Definition: internal.h:765
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:787
void * default_handler_cls
Definition: internal.h:1266
volatile bool shutdown
Definition: internal.h:1526
MHD_ResponseFlags
Definition: microhttpd.h:2929
MHD_TLS_CONN_STATE
Definition: internal.h:541
MHD_mutex_ cleanup_connection_mutex
Definition: internal.h:1265
uint64_t current_chunk_size
Definition: internal.h:950
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:668
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1029
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:673
size_t pool_increment
Definition: internal.h:1455
void MHD_unescape_plus(char *arg)
Definition: internal.c:119