GNU libmicrohttpd  0.9.62
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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 
607 struct MHD_Connection
608 {
609 
610 #ifdef EPOLL_SUPPORT
611 
614  struct MHD_Connection *nextE;
615 
619  struct MHD_Connection *prevE;
620 #endif
621 
625  struct MHD_Connection *next;
626 
630  struct MHD_Connection *prev;
631 
639  struct MHD_Connection *nextX;
640 
644  struct MHD_Connection *prevX;
645 
649  struct MHD_Daemon *daemon;
650 
655 
660 
665 
674  struct MemoryPool *pool;
675 
683 
691  void *socket_context;
692 
696  char *method;
697 
702  const char *url;
703 
708  char *version;
709 
716 
722  char *read_buffer;
723 
729 
736  char *last;
737 
745  char *colon;
746 
751  struct sockaddr *addr;
752 
753 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
754 
758  MHD_thread_handle_ID_ pid;
759 #endif
760 
768 
774 
779 
784 
790 
795  size_t header_size;
796 
802 
809 
810 #if defined(_MHD_HAVE_SENDFILE)
811  enum MHD_resp_sender_
812  {
813  MHD_resp_sender_std = 0,
814  MHD_resp_sender_sendfile
815  } resp_sender;
816 #endif /* _MHD_HAVE_SENDFILE */
817 
823 
827  socklen_t addr_len;
828 
833  time_t last_activity;
834 
839  time_t connection_timeout;
840 
845 
852 
859 
863  bool sk_nonblck;
864 
871  bool read_closed;
872 
873 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
874 
877  bool thread_joined;
878 #endif
879 
884  bool in_idle;
885 
891 
892 #ifdef EPOLL_SUPPORT
893 
896  enum MHD_EpollState epoll_state;
897 #endif
898 
903 
908 
913  unsigned int responseCode;
914 
923 
931 
937 
942 
947 
948 #ifdef UPGRADE_SUPPORT
949 
955  struct MHD_UpgradeResponseHandle *urh;
956 #endif /* UPGRADE_SUPPORT */
957 
958 #ifdef HTTPS_SUPPORT
959 
963  gnutls_session_t tls_session;
964 
968  int protocol;
969 
973  int cipher;
974 
978  enum MHD_TLS_CONN_STATE tls_state;
979 
984  bool tls_read_ready;
985 #endif /* HTTPS_SUPPORT */
986 
990  bool suspended;
991 
996 
1000  bool resuming;
1001 };
1002 
1003 
1004 #ifdef UPGRADE_SUPPORT
1005 
1014 #define RESERVE_EBUF_SIZE 8
1015 
1022 struct UpgradeEpollHandle
1023 {
1028  struct MHD_UpgradeResponseHandle *urh;
1029 
1045  MHD_socket socket;
1046 
1050  enum MHD_EpollState celi;
1051 
1052 };
1053 
1054 
1060 struct MHD_UpgradeResponseHandle
1061 {
1067  struct MHD_Connection *connection;
1068 
1069 #ifdef HTTPS_SUPPORT
1070 
1073  struct MHD_UpgradeResponseHandle *next;
1074 
1078  struct MHD_UpgradeResponseHandle *prev;
1079 
1080 #ifdef EPOLL_SUPPORT
1081 
1084  struct MHD_UpgradeResponseHandle *nextE;
1085 
1089  struct MHD_UpgradeResponseHandle *prevE;
1090 
1094  bool in_eready_list;
1095 #endif
1096 
1102  char *in_buffer;
1103 
1109  char *out_buffer;
1110 
1116  size_t in_buffer_size;
1117 
1123  size_t out_buffer_size;
1124 
1132  size_t in_buffer_used;
1133 
1141  size_t out_buffer_used;
1142 
1146  struct UpgradeEpollHandle app;
1147 
1152  struct UpgradeEpollHandle mhd;
1153 
1158  char e_buf[RESERVE_EBUF_SIZE];
1159 
1160 #endif /* HTTPS_SUPPORT */
1161 
1172  volatile bool was_closed;
1173 
1195  bool clean_ready;
1196 };
1197 #endif /* UPGRADE_SUPPORT */
1198 
1199 
1208 typedef void *
1209 (*LogCallback)(void *cls,
1210  const char *uri,
1211  struct MHD_Connection *con);
1212 
1222 typedef size_t
1223 (*UnescapeCallback)(void *cls,
1224  struct MHD_Connection *conn,
1225  char *uri);
1226 
1227 
1235 struct MHD_Daemon
1236 {
1237 
1242 
1247 
1252 
1257 
1262 
1267 
1271  struct MHD_Connection *cleanup_head;
1272 
1276  struct MHD_Connection *cleanup_tail;
1277 
1278 #ifdef EPOLL_SUPPORT
1279 
1282  struct MHD_Connection *eready_head;
1283 
1287  struct MHD_Connection *eready_tail;
1288 
1289 #ifdef UPGRADE_SUPPORT
1290 
1293  struct MHD_UpgradeResponseHandle *eready_urh_head;
1294 
1298  struct MHD_UpgradeResponseHandle *eready_urh_tail;
1299 #endif /* UPGRADE_SUPPORT */
1300 #endif /* EPOLL_SUPPORT */
1301 
1317 
1324 
1332 
1339 
1345 
1349  void *apc_cls;
1350 
1356 
1361 
1367 
1372 
1381 
1386 
1391 
1396 
1397 #ifdef HAVE_MESSAGES
1398 
1402  void (*custom_error_log) (void *cls, const char *fmt, va_list va);
1403 
1407  void *custom_error_log_cls;
1408 #endif
1409 
1413  struct MHD_Daemon *master;
1414 
1415 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1416 
1419  struct MHD_Daemon *worker_pool;
1420 #endif
1421 
1426 
1430  size_t pool_size;
1431 
1436 
1437 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1438 
1441  size_t thread_stack_size;
1442 
1446  unsigned int worker_pool_size;
1447 
1451  MHD_thread_handle_ID_ pid;
1452 
1456  MHD_mutex_ per_ip_connection_mutex;
1457 
1462  MHD_mutex_ cleanup_connection_mutex;
1463 #endif
1464 
1469 
1480 
1481 #ifdef EPOLL_SUPPORT
1482 
1485  int epoll_fd;
1486 
1491  bool listen_socket_in_epoll;
1492 
1493 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
1494 
1498  int epoll_upgrade_fd;
1499 
1504  bool upgrade_fd_in_epoll;
1505 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
1506 
1507 #endif
1508 
1513  struct MHD_itc_ itc;
1514 
1518  volatile bool shutdown;
1519 
1525  volatile bool was_quiesced;
1526 
1534  bool at_limit;
1535 
1536  /*
1537  * Do we need to process resuming connections?
1538  */
1539  bool resuming;
1540 
1550  bool data_already_pending;
1551 
1555  unsigned int connections;
1556 
1560  unsigned int connection_limit;
1561 
1567 
1573 
1578 
1582  uint16_t port;
1583 
1588 
1589 #ifdef HTTPS_SUPPORT
1590 #ifdef UPGRADE_SUPPORT
1591 
1596  struct MHD_UpgradeResponseHandle *urh_head;
1597 
1603  struct MHD_UpgradeResponseHandle *urh_tail;
1604 #endif /* UPGRADE_SUPPORT */
1605 
1609  gnutls_priority_t priority_cache;
1610 
1615  gnutls_credentials_type_t cred_type;
1616 
1620  gnutls_certificate_credentials_t x509_cred;
1621 
1625  gnutls_dh_params_t dh_params;
1626 
1630  gnutls_psk_server_credentials_t psk_cred;
1631 
1632 #if GNUTLS_VERSION_MAJOR >= 3
1633 
1637  gnutls_certificate_retrieve_function2 *cert_callback;
1638 
1642  MHD_PskServerCredentialsCallback cred_callback;
1643 
1647  void *cred_callback_cls;
1648 #endif
1649 
1653  const char *https_mem_key;
1654 
1658  const char *https_mem_cert;
1659 
1663  const char *https_key_password;
1664 
1668  const char *https_mem_trust;
1669 
1673  gnutls_dh_params_t https_mem_dhparams;
1674 
1678  bool have_dhparams;
1679 
1680 #endif /* HTTPS_SUPPORT */
1681 
1682 #ifdef DAUTH_SUPPORT
1683 
1687  const char *digest_auth_random;
1688 
1692  struct MHD_NonceNc *nnc;
1693 
1694 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
1695 
1698  MHD_mutex_ nnc_lock;
1699 #endif
1700 
1704  size_t digest_auth_rand_size;
1705 
1709  unsigned int nonce_nc_size;
1710 
1711 #endif
1712 
1713 #ifdef TCP_FASTOPEN
1714 
1717  unsigned int fastopen_queue_size;
1718 #endif
1719 
1723  unsigned int listen_backlog_size;
1724 };
1725 
1726 
1735 #define DLL_insert(head,tail,element) do { \
1736  mhd_assert (NULL == (element)->next); \
1737  mhd_assert (NULL == (element)->prev); \
1738  (element)->next = (head); \
1739  (element)->prev = NULL; \
1740  if ((tail) == NULL) \
1741  (tail) = element; \
1742  else \
1743  (head)->prev = element; \
1744  (head) = (element); } while (0)
1745 
1746 
1756 #define DLL_remove(head,tail,element) do { \
1757  mhd_assert ( (NULL != (element)->next) || ((element) == (tail))); \
1758  mhd_assert ( (NULL != (element)->prev) || ((element) == (head))); \
1759  if ((element)->prev == NULL) \
1760  (head) = (element)->next; \
1761  else \
1762  (element)->prev->next = (element)->next; \
1763  if ((element)->next == NULL) \
1764  (tail) = (element)->prev; \
1765  else \
1766  (element)->next->prev = (element)->prev; \
1767  (element)->next = NULL; \
1768  (element)->prev = NULL; } while (0)
1769 
1770 
1771 
1780 #define XDLL_insert(head,tail,element) do { \
1781  mhd_assert (NULL == (element)->nextX); \
1782  mhd_assert (NULL == (element)->prevX); \
1783  (element)->nextX = (head); \
1784  (element)->prevX = NULL; \
1785  if (NULL == (tail)) \
1786  (tail) = element; \
1787  else \
1788  (head)->prevX = element; \
1789  (head) = (element); } while (0)
1790 
1791 
1801 #define XDLL_remove(head,tail,element) do { \
1802  mhd_assert ( (NULL != (element)->nextX) || ((element) == (tail))); \
1803  mhd_assert ( (NULL != (element)->prevX) || ((element) == (head))); \
1804  if (NULL == (element)->prevX) \
1805  (head) = (element)->nextX; \
1806  else \
1807  (element)->prevX->nextX = (element)->nextX; \
1808  if (NULL == (element)->nextX) \
1809  (tail) = (element)->prevX; \
1810  else \
1811  (element)->nextX->prevX = (element)->prevX; \
1812  (element)->nextX = NULL; \
1813  (element)->prevX = NULL; } while (0)
1814 
1815 
1824 #define EDLL_insert(head,tail,element) do { \
1825  (element)->nextE = (head); \
1826  (element)->prevE = NULL; \
1827  if ((tail) == NULL) \
1828  (tail) = element; \
1829  else \
1830  (head)->prevE = element; \
1831  (head) = (element); } while (0)
1832 
1833 
1843 #define EDLL_remove(head,tail,element) do { \
1844  if ((element)->prevE == NULL) \
1845  (head) = (element)->nextE; \
1846  else \
1847  (element)->prevE->nextE = (element)->nextE; \
1848  if ((element)->nextE == NULL) \
1849  (tail) = (element)->prevE; \
1850  else \
1851  (element)->nextE->prevE = (element)->prevE; \
1852  (element)->nextE = NULL; \
1853  (element)->prevE = NULL; } while (0)
1854 
1855 
1861 void
1862 MHD_unescape_plus (char *arg);
1863 
1864 
1876 typedef int
1878  const char *key,
1879  const char *value,
1880  enum MHD_ValueKind kind);
1881 
1882 
1897 int
1898 MHD_parse_arguments_ (struct MHD_Connection *connection,
1899  enum MHD_ValueKind kind,
1900  char *args,
1902  unsigned int *num_headers);
1903 
1904 
1918 bool
1920  const char *key,
1921  const char *token,
1922  size_t token_len);
1923 
1935 #define MHD_check_response_header_s_token_ci(r,k,tkn) \
1936  MHD_check_response_header_token_ci((r),(k),(tkn),MHD_STATICSTR_LEN_(tkn))
1937 
1938 
1948 void
1949 internal_suspend_connection_ (struct MHD_Connection *connection);
1950 
1951 #endif
bool thread_joined
Definition: internal.h:776
unsigned int per_ip_connection_limit
Definition: internal.h:1572
void * unescape_callback_cls
Definition: internal.h:1395
uint64_t total_size
Definition: internal.h:1639
bool have_chunked_upload
Definition: internal.h:922
additional automatic macros for MHD_config.h
uint64_t fd_off
Definition: internal.h:1650
uint64_t current_chunk_offset
Definition: internal.h:936
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
struct MHD_Connection * cleanup_head
Definition: internal.h:1174
enum MHD_CONNECTION_STATE state
Definition: internal.h:902
uint64_t response_write_position
Definition: internal.h:808
public interface to libmicrohttpd
enum MHD_ConnKeepAlive keepalive
Definition: internal.h:715
void * mhd_panic_cls
Definition: panic.c:36
MHD_mutex_lock_chk_ & daemon
enum MHD_ConnectionEventLoopInfo event_loop_info
Definition: internal.h:907
struct MHD_Connection * prevX
Definition: internal.h:667
MHD_thread_handle_ID_ pid
Definition: internal.h:1246
time_t connection_timeout
Definition: internal.h:1566
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1603
MHD_PanicCallback mhd_panic
Definition: panic.c:31
MHD_CONNECTION_STATE
Definition: internal.h:407
char * version
Definition: internal.h:708
int suspended_dummy
Definition: internal.h:995
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2100
struct MHD_Response * response
Definition: internal.h:664
char * data
Definition: internal.h:1585
char * colon
Definition: internal.h:745
char * write_buffer
Definition: internal.h:728
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:1985
void *(* LogCallback)(void *cls, const char *uri, struct MHD_Connection *con)
Definition: internal.h:1209
volatile bool was_quiesced
Definition: internal.h:1525
struct MHD_Connection * prev
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
struct MHD_Connection * manual_timeout_head
Definition: internal.h:1140
size_t data_size
Definition: internal.h:1656
MHD_thread_handle_ID_ pid
Definition: internal.h:720
char * value
Definition: internal.h:349
enum MHD_ValueKind kind
Definition: internal.h:355
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2011
MHD_AccessHandlerCallback default_handler
Definition: internal.h:1241
int MHD_socket
Definition: microhttpd.h:181
uint64_t remaining_upload_size
Definition: internal.h:801
unsigned int responseCode
Definition: internal.h:913
platform-specific includes for libmicrohttpd
char * header
Definition: internal.h:344
void * uri_log_callback_cls
Definition: internal.h:1385
struct MHD_Daemon * daemon
Definition: internal.h:672
size_t header_size
Definition: internal.h:795
Types for platform-independent inter-thread communication.
int listening_address_reuse
Definition: internal.h:1479
MHD_mutex_ per_ip_connection_mutex
Definition: internal.h:1256
MHD_NotifyConnectionCallback notify_connection
Definition: internal.h:1366
struct MHD_Connection * next
Definition: internal.h:648
bool client_aware
Definition: internal.h:851
int strict_for_client
Definition: internal.h:1587
void * socket_context
Definition: internal.h:691
struct MHD_HTTP_Header * first_header
Definition: internal.h:1579
uint64_t nmask
Definition: internal.h:237
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
Definition: microhttpd.h:1182
size_t data_buffer_size
Definition: internal.h:1661
size_t write_buffer_send_offset
Definition: internal.h:783
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:767
macros for mhd_assert()
void * client_context
Definition: internal.h:682
const char * url
Definition: internal.h:702
size_t continue_message_write_offset
Definition: internal.h:822
MHD_socket socket_fd
Definition: internal.h:749
char * method
Definition: internal.h:696
unsigned int connection_limit
Definition: internal.h:1560
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:1577
struct MHD_Connection * connections_head
Definition: internal.h:1152
LogCallback uri_log_callback
Definition: internal.h:1380
bool in_cleanup
Definition: internal.h:890
unsigned int reference_count
Definition: internal.h:1672
time_t connection_timeout
Definition: internal.h:742
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:1917
#define MAX_NONCE_LENGTH
Definition: internal.h:217
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2084
size_t(* UnescapeCallback)(void *cls, struct MHD_Connection *conn, char *uri)
Definition: internal.h:1223
struct MHD_Daemon * master
Definition: internal.h:1065
struct MHD_Connection * manual_timeout_tail
Definition: internal.h:1147
uint16_t port
Definition: internal.h:1582
char * last
Definition: internal.h:736
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:722
MHD_EpollState
Definition: internal.h:584
ReceiveCallback recv_cls
Definition: internal.h:703
size_t write_buffer_size
Definition: internal.h:778
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:1390
void internal_suspend_connection_(struct MHD_Connection *connection)
Definition: daemon.c:2686
unsigned int listen_backlog_size
Definition: internal.h:1723
unsigned int connection_timeout_dummy
Definition: internal.h:844
struct MHD_Connection * suspended_connections_tail
Definition: internal.h:1169
size_t pool_size
Definition: internal.h:1430
bool tls_read_ready
Definition: internal.h:766
struct MHD_itc_ itc
Definition: internal.h:1407
MHD_AcceptPolicyCallback apc
Definition: internal.h:1344
time_t last_activity
Definition: internal.h:736
struct MHD_Connection * cleanup_tail
Definition: internal.h:1179
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
size_t write_buffer_append_offset
Definition: internal.h:789
MHD_ConnKeepAlive
Definition: internal.h:151
struct MHD_Connection * normal_timeout_tail
Definition: internal.h:1132
MHD_RequestCompletedCallback notify_completed
Definition: internal.h:1355
bool resuming
Definition: internal.h:1507
bool read_closed
Definition: internal.h:789
void * notify_completed_cls
Definition: internal.h:1360
MHD_socket listen_fd
Definition: internal.h:1468
struct MemoryPool * pool
Definition: internal.h:682
TransmitCallback send_cls
Definition: internal.h:708
void * notify_connection_cls
Definition: internal.h:1371
void * apc_cls
Definition: internal.h:1349
MHD_ContentReaderCallback crc
Definition: internal.h:1597
bool(* MHD_ArgumentIterator_)(struct MHD_Request *request, const char *key, const char *value, enum MHD_ValueKind kind)
Definition: internal.h:1705
bool at_limit
Definition: internal.h:1480
struct sockaddr * addr
Definition: internal.h:751
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
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
size_t read_buffer_offset
Definition: internal.h:773
void * default_handler_cls
Definition: internal.h:1246
volatile bool shutdown
Definition: internal.h:1523
MHD_ResponseFlags
Definition: microhttpd.h:2615
ssize_t(* TransmitCallback)(struct MHD_Connection *conn, const void *read_from, size_t max_bytes)
Definition: internal.h:193
MHD_TLS_CONN_STATE
Definition: internal.h:528
MHD_mutex_ cleanup_connection_mutex
Definition: internal.h:1262
void MHD_unescape_plus(char *arg)
Definition: internal.c:119
uint64_t current_chunk_size
Definition: internal.h:930
struct MHD_HTTP_Header * headers_received
Definition: internal.h:654
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
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:888
ssize_t(* ReceiveCallback)(struct MHD_Connection *conn, void *write_to, size_t max_bytes)
Definition: internal.h:179
struct MHD_HTTP_Header * headers_received_tail
Definition: internal.h:659
size_t pool_increment
Definition: internal.h:1435
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:1903