aboutsummaryrefslogtreecommitdiff
path: root/src/include/microhttpd2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/microhttpd2.h')
-rw-r--r--src/include/microhttpd2.h488
1 files changed, 257 insertions, 231 deletions
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
index 710115d1..9716573c 100644
--- a/src/include/microhttpd2.h
+++ b/src/include/microhttpd2.h
@@ -99,9 +99,9 @@ extern "C"
99#include <stdarg.h> 99#include <stdarg.h>
100#include <stdint.h> 100#include <stdint.h>
101#include <sys/types.h> 101#include <sys/types.h>
102#if defined(_WIN32) && !defined(__CYGWIN__) 102#if defined(_WIN32) && ! defined(__CYGWIN__)
103#include <ws2tcpip.h> 103#include <ws2tcpip.h>
104#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED) 104#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
105#define _SSIZE_T_DEFINED 105#define _SSIZE_T_DEFINED
106typedef intptr_t ssize_t; 106typedef intptr_t ssize_t;
107#endif /* !_SSIZE_T_DEFINED */ 107#endif /* !_SSIZE_T_DEFINED */
@@ -112,7 +112,7 @@ typedef intptr_t ssize_t;
112#endif 112#endif
113#endif 113#endif
114 114
115#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET) 115#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
116/* Do not define __USE_W32_SOCKETS under Cygwin! */ 116/* Do not define __USE_W32_SOCKETS under Cygwin! */
117#error Cygwin with winsock fd_set is not supported 117#error Cygwin with winsock fd_set is not supported
118#endif 118#endif
@@ -179,7 +179,7 @@ enum MHD_Bool
179/** 179/**
180 * MHD_socket is type for socket FDs 180 * MHD_socket is type for socket FDs
181 */ 181 */
182#if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) 182#if ! defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
183#define MHD_POSIX_SOCKETS 1 183#define MHD_POSIX_SOCKETS 1
184typedef int MHD_socket; 184typedef int MHD_socket;
185#define MHD_INVALID_SOCKET (-1) 185#define MHD_INVALID_SOCKET (-1)
@@ -204,30 +204,35 @@ typedef SOCKET MHD_socket;
204#endif /* MHD_NO_DEPRECATION */ 204#endif /* MHD_NO_DEPRECATION */
205 205
206#ifndef _MHD_DEPR_MACRO 206#ifndef _MHD_DEPR_MACRO
207#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500 207#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1500
208/* VS 2008 or later */ 208/* VS 2008 or later */
209/* Stringify macros */ 209/* Stringify macros */
210#define _MHD_INSTRMACRO(a) #a 210#define _MHD_INSTRMACRO(a) #a
211#define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a) 211#define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a)
212/* deprecation message */ 212/* deprecation message */
213#define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg)) 213#define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \
214#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 214 __LINE__) "): warning: " msg))
215#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
215#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) 216#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
216/* clang or GCC since 3.0 */ 217/* clang or GCC since 3.0 */
217#define _MHD_GCC_PRAG(x) _Pragma (#x) 218#define _MHD_GCC_PRAG(x) _Pragma (#x)
218#if (defined(__clang__) && (__clang_major__+0 >= 5 || \ 219#if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \
219 (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) || \ 220 (! defined(__apple_build_version__) && \
220 __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8) 221 (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \
222 3))))) || \
223 __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8)
221/* clang >= 3.3 (or XCode's clang >= 5.0) or 224/* clang >= 3.3 (or XCode's clang >= 5.0) or
222 GCC >= 4.8 */ 225 GCC >= 4.8 */
223#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg) 226#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg)
224#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 227#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
225#else /* older clang or GCC */ 228#else /* older clang or GCC */
226/* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */ 229/* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
227#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg) 230#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg)
228#if (defined(__clang__) && (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: clang >= 2.9, earlier versions not tested */ 231#if (defined(__clang__) && (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == \
232 2 && __clang_minor__ >= \
233 9))) /* FIXME: clang >= 2.9, earlier versions not tested */
229/* clang handles inline pragmas better than GCC */ 234/* clang handles inline pragmas better than GCC */
230#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 235#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
231#endif /* clang >= 2.9 */ 236#endif /* clang >= 2.9 */
232#endif /* older clang or GCC */ 237#endif /* older clang or GCC */
233/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ 238/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
@@ -244,17 +249,19 @@ typedef SOCKET MHD_socket;
244#endif /* !_MHD_DEPR_IN_MACRO */ 249#endif /* !_MHD_DEPR_IN_MACRO */
245 250
246#ifndef _MHD_DEPR_FUNC 251#ifndef _MHD_DEPR_FUNC
247#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400 252#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400
248/* VS 2005 or later */ 253/* VS 2005 or later */
249#define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg)) 254#define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg))
250#elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310 255#elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310
251/* VS .NET 2003 deprecation do not support custom messages */ 256/* VS .NET 2003 deprecation do not support custom messages */
252#define _MHD_DEPR_FUNC(msg) __declspec(deprecated) 257#define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
253#elif (__GNUC__+0 >= 5) || (defined (__clang__) && \ 258#elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \
254 (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: earlier versions not tested */ 259 (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \
260 9))) /* FIXME: earlier versions not tested */
255/* GCC >= 5.0 or clang >= 2.9 */ 261/* GCC >= 5.0 or clang >= 2.9 */
256#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg))) 262#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg)))
257#elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1) 263#elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \
264 __GNUC_MINOR__ + 0 >= 1)
258/* 3.1 <= GCC < 5.0 or clang < 2.9 */ 265/* 3.1 <= GCC < 5.0 or clang < 2.9 */
259/* old GCC-style deprecation do not support custom messages */ 266/* old GCC-style deprecation do not support custom messages */
260#define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__)) 267#define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
@@ -277,7 +284,7 @@ typedef SOCKET MHD_socket;
277#if defined(__CYGWIN__) || defined(_WIN32) || defined(MHD_W32LIB) 284#if defined(__CYGWIN__) || defined(_WIN32) || defined(MHD_W32LIB)
278#define MHD_NONNULL(...) /* empty */ 285#define MHD_NONNULL(...) /* empty */
279#else 286#else
280#define MHD_NONNULL(...) __THROW __nonnull((__VA_ARGS__)) 287#define MHD_NONNULL(...) __THROW __nonnull ((__VA_ARGS__))
281#endif 288#endif
282 289
283/** 290/**
@@ -1110,8 +1117,8 @@ enum MHD_Method
1110 */ 1117 */
1111 MHD_METHOD_VERSION_CONTROL = 38 1118 MHD_METHOD_VERSION_CONTROL = 38
1112 1119
1113 /* For more, check: 1120 /* For more, check:
1114 https://www.iana.org/assignments/http-methods/http-methods.xhtml */ 1121 https://www.iana.org/assignments/http-methods/http-methods.xhtml */
1115 1122
1116}; 1123};
1117 1124
@@ -1123,7 +1130,8 @@ enum MHD_Method
1123 * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4 1130 * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
1124 * @{ 1131 * @{
1125 */ 1132 */
1126#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded" 1133#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \
1134 "application/x-www-form-urlencoded"
1127#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data" 1135#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
1128 1136
1129/** @} */ /* end of group postenc */ 1137/** @} */ /* end of group postenc */
@@ -1386,7 +1394,8 @@ enum MHD_Method
1386/* Standard. RFC7469 */ 1394/* Standard. RFC7469 */
1387#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins" 1395#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
1388/* Standard. RFC7469 */ 1396/* Standard. RFC7469 */
1389#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY "Public-Key-Pins-Report-Only" 1397#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \
1398 "Public-Key-Pins-Report-Only"
1390/* No category. RFC4437 */ 1399/* No category. RFC4437 */
1391#define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref" 1400#define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
1392/* No category. RFC4229 */ 1401/* No category. RFC4229 */
@@ -1445,7 +1454,8 @@ enum MHD_Method
1445#define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options" 1454#define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
1446 1455
1447/* Some provisional headers. */ 1456/* Some provisional headers. */
1448#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin" 1457#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \
1458 "Access-Control-Allow-Origin"
1449/** @} */ /* end of group headers */ 1459/** @} */ /* end of group headers */
1450 1460
1451 1461
@@ -1468,9 +1478,9 @@ enum MHD_Method
1468 */ 1478 */
1469typedef const struct MHD_Action * 1479typedef const struct MHD_Action *
1470(*MHD_RequestCallback) (void *cls, 1480(*MHD_RequestCallback) (void *cls,
1471 struct MHD_Request *request, 1481 struct MHD_Request *request,
1472 const char *url, 1482 const char *url,
1473 enum MHD_Method method); 1483 enum MHD_Method method);
1474 1484
1475 1485
1476/** 1486/**
@@ -1484,8 +1494,8 @@ typedef const struct MHD_Action *
1484 */ 1494 */
1485_MHD_EXTERN struct MHD_Daemon * 1495_MHD_EXTERN struct MHD_Daemon *
1486MHD_daemon_create (MHD_RequestCallback cb, 1496MHD_daemon_create (MHD_RequestCallback cb,
1487 void *cb_cls) 1497 void *cb_cls)
1488 MHD_NONNULL(1); 1498MHD_NONNULL (1);
1489 1499
1490 1500
1491/** 1501/**
@@ -1498,7 +1508,7 @@ MHD_daemon_create (MHD_RequestCallback cb,
1498 */ 1508 */
1499_MHD_EXTERN enum MHD_StatusCode 1509_MHD_EXTERN enum MHD_StatusCode
1500MHD_daemon_start (struct MHD_Daemon *daemon) 1510MHD_daemon_start (struct MHD_Daemon *daemon)
1501 MHD_NONNULL(1); 1511MHD_NONNULL (1);
1502 1512
1503 1513
1504/** 1514/**
@@ -1523,7 +1533,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
1523 */ 1533 */
1524_MHD_EXTERN MHD_socket 1534_MHD_EXTERN MHD_socket
1525MHD_daemon_quiesce (struct MHD_Daemon *daemon) 1535MHD_daemon_quiesce (struct MHD_Daemon *daemon)
1526 MHD_NONNULL(1); 1536MHD_NONNULL (1);
1527 1537
1528 1538
1529/** 1539/**
@@ -1534,7 +1544,7 @@ MHD_daemon_quiesce (struct MHD_Daemon *daemon)
1534 */ 1544 */
1535_MHD_EXTERN void 1545_MHD_EXTERN void
1536MHD_daemon_destroy (struct MHD_Daemon *daemon) 1546MHD_daemon_destroy (struct MHD_Daemon *daemon)
1537 MHD_NONNULL(1); 1547MHD_NONNULL (1);
1538 1548
1539 1549
1540/** 1550/**
@@ -1564,10 +1574,10 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
1564 */ 1574 */
1565_MHD_EXTERN enum MHD_StatusCode 1575_MHD_EXTERN enum MHD_StatusCode
1566MHD_daemon_add_connection (struct MHD_Daemon *daemon, 1576MHD_daemon_add_connection (struct MHD_Daemon *daemon,
1567 MHD_socket client_socket, 1577 MHD_socket client_socket,
1568 const struct sockaddr *addr, 1578 const struct sockaddr *addr,
1569 socklen_t addrlen) 1579 socklen_t addrlen)
1570 MHD_NONNULL(1); 1580MHD_NONNULL (1);
1571 1581
1572 1582
1573/** 1583/**
@@ -1596,11 +1606,11 @@ MHD_daemon_add_connection (struct MHD_Daemon *daemon,
1596 */ 1606 */
1597_MHD_EXTERN enum MHD_StatusCode 1607_MHD_EXTERN enum MHD_StatusCode
1598MHD_daemon_get_fdset (struct MHD_Daemon *daemon, 1608MHD_daemon_get_fdset (struct MHD_Daemon *daemon,
1599 fd_set *read_fd_set, 1609 fd_set *read_fd_set,
1600 fd_set *write_fd_set, 1610 fd_set *write_fd_set,
1601 fd_set *except_fd_set, 1611 fd_set *except_fd_set,
1602 MHD_socket *max_fd) 1612 MHD_socket *max_fd)
1603 MHD_NONNULL(1,2,3,4); 1613MHD_NONNULL (1,2,3,4);
1604 1614
1605 1615
1606/** 1616/**
@@ -1632,12 +1642,12 @@ MHD_daemon_get_fdset (struct MHD_Daemon *daemon,
1632 */ 1642 */
1633_MHD_EXTERN enum MHD_StatusCode 1643_MHD_EXTERN enum MHD_StatusCode
1634MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon, 1644MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
1635 fd_set *read_fd_set, 1645 fd_set *read_fd_set,
1636 fd_set *write_fd_set, 1646 fd_set *write_fd_set,
1637 fd_set *except_fd_set, 1647 fd_set *except_fd_set,
1638 MHD_socket *max_fd, 1648 MHD_socket *max_fd,
1639 unsigned int fd_setsize) 1649 unsigned int fd_setsize)
1640 MHD_NONNULL(1,2,3,4); 1650MHD_NONNULL (1,2,3,4);
1641 1651
1642 1652
1643/** 1653/**
@@ -1662,8 +1672,10 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
1662 * fit fd_set. 1672 * fit fd_set.
1663 * @ingroup event 1673 * @ingroup event
1664 */ 1674 */
1665#define MHD_daemon_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \ 1675#define MHD_daemon_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set, \
1666 MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE) 1676 max_fd) \
1677 MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \
1678 (max_fd),FD_SETSIZE)
1667 1679
1668 1680
1669/** 1681/**
@@ -1687,8 +1699,8 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
1687 */ 1699 */
1688_MHD_EXTERN enum MHD_StatusCode 1700_MHD_EXTERN enum MHD_StatusCode
1689MHD_daemon_get_timeout (struct MHD_Daemon *daemon, 1701MHD_daemon_get_timeout (struct MHD_Daemon *daemon,
1690 MHD_UNSIGNED_LONG_LONG *timeout) 1702 MHD_UNSIGNED_LONG_LONG *timeout)
1691 MHD_NONNULL(1,2); 1703MHD_NONNULL (1,2);
1692 1704
1693 1705
1694/** 1706/**
@@ -1711,7 +1723,7 @@ MHD_daemon_get_timeout (struct MHD_Daemon *daemon,
1711 */ 1723 */
1712_MHD_EXTERN enum MHD_StatusCode 1724_MHD_EXTERN enum MHD_StatusCode
1713MHD_daemon_run (struct MHD_Daemon *daemon) 1725MHD_daemon_run (struct MHD_Daemon *daemon)
1714 MHD_NONNULL(1); 1726MHD_NONNULL (1);
1715 1727
1716 1728
1717/** 1729/**
@@ -1738,10 +1750,10 @@ MHD_daemon_run (struct MHD_Daemon *daemon)
1738 */ 1750 */
1739_MHD_EXTERN enum MHD_StatusCode 1751_MHD_EXTERN enum MHD_StatusCode
1740MHD_daemon_run_from_select (struct MHD_Daemon *daemon, 1752MHD_daemon_run_from_select (struct MHD_Daemon *daemon,
1741 const fd_set *read_fd_set, 1753 const fd_set *read_fd_set,
1742 const fd_set *write_fd_set, 1754 const fd_set *write_fd_set,
1743 const fd_set *except_fd_set) 1755 const fd_set *except_fd_set)
1744 MHD_NONNULL(1,2,3,4); 1756MHD_NONNULL (1,2,3,4);
1745 1757
1746 1758
1747/* ********************* daemon options ************** */ 1759/* ********************* daemon options ************** */
@@ -1758,9 +1770,9 @@ MHD_daemon_run_from_select (struct MHD_Daemon *daemon,
1758 */ 1770 */
1759typedef void 1771typedef void
1760(*MHD_LoggingCallback)(void *cls, 1772(*MHD_LoggingCallback)(void *cls,
1761 enum MHD_StatusCode sc, 1773 enum MHD_StatusCode sc,
1762 const char *fm, 1774 const char *fm,
1763 va_list ap); 1775 va_list ap);
1764 1776
1765 1777
1766/** 1778/**
@@ -1774,9 +1786,9 @@ typedef void
1774 */ 1786 */
1775_MHD_EXTERN void 1787_MHD_EXTERN void
1776MHD_daemon_set_logger (struct MHD_Daemon *daemon, 1788MHD_daemon_set_logger (struct MHD_Daemon *daemon,
1777 MHD_LoggingCallback logger, 1789 MHD_LoggingCallback logger,
1778 void *logger_cls) 1790 void *logger_cls)
1779 MHD_NONNULL(1); 1791MHD_NONNULL (1);
1780 1792
1781 1793
1782/** 1794/**
@@ -1784,7 +1796,8 @@ MHD_daemon_set_logger (struct MHD_Daemon *daemon,
1784 * 1796 *
1785 * @param daemon which instance to disable logging for 1797 * @param daemon which instance to disable logging for
1786 */ 1798 */
1787#define MHD_daemon_disable_logging(daemon) MHD_daemon_set_logger (daemon, NULL, NULL) 1799#define MHD_daemon_disable_logging(daemon) MHD_daemon_set_logger (daemon, NULL, \
1800 NULL)
1788 1801
1789 1802
1790/** 1803/**
@@ -1794,7 +1807,7 @@ MHD_daemon_set_logger (struct MHD_Daemon *daemon,
1794 */ 1807 */
1795_MHD_EXTERN void 1808_MHD_EXTERN void
1796MHD_daemon_suppress_date_no_clock (struct MHD_Daemon *daemon) 1809MHD_daemon_suppress_date_no_clock (struct MHD_Daemon *daemon)
1797 MHD_NONNULL(1); 1810MHD_NONNULL (1);
1798 1811
1799 1812
1800/** 1813/**
@@ -1816,7 +1829,7 @@ MHD_daemon_suppress_date_no_clock (struct MHD_Daemon *daemon)
1816 */ 1829 */
1817_MHD_EXTERN void 1830_MHD_EXTERN void
1818MHD_daemon_disable_itc (struct MHD_Daemon *daemon) 1831MHD_daemon_disable_itc (struct MHD_Daemon *daemon)
1819 MHD_NONNULL(1); 1832MHD_NONNULL (1);
1820 1833
1821 1834
1822/** 1835/**
@@ -1829,7 +1842,7 @@ MHD_daemon_disable_itc (struct MHD_Daemon *daemon)
1829 */ 1842 */
1830_MHD_EXTERN void 1843_MHD_EXTERN void
1831MHD_daemon_enable_turbo (struct MHD_Daemon *daemon) 1844MHD_daemon_enable_turbo (struct MHD_Daemon *daemon)
1832 MHD_NONNULL(1); 1845MHD_NONNULL (1);
1833 1846
1834 1847
1835/** 1848/**
@@ -1843,7 +1856,7 @@ MHD_daemon_enable_turbo (struct MHD_Daemon *daemon)
1843 */ 1856 */
1844_MHD_EXTERN void 1857_MHD_EXTERN void
1845MHD_daemon_disallow_suspend_resume (struct MHD_Daemon *daemon) 1858MHD_daemon_disallow_suspend_resume (struct MHD_Daemon *daemon)
1846 MHD_NONNULL(1); 1859MHD_NONNULL (1);
1847 1860
1848 1861
1849/** 1862/**
@@ -1859,7 +1872,7 @@ MHD_daemon_disallow_suspend_resume (struct MHD_Daemon *daemon)
1859 */ 1872 */
1860_MHD_EXTERN void 1873_MHD_EXTERN void
1861MHD_daemon_disallow_upgrade (struct MHD_Daemon *daemon) 1874MHD_daemon_disallow_upgrade (struct MHD_Daemon *daemon)
1862 MHD_NONNULL(1); 1875MHD_NONNULL (1);
1863 1876
1864 1877
1865/** 1878/**
@@ -1904,9 +1917,9 @@ enum MHD_FastOpenMethod
1904 */ 1917 */
1905_MHD_EXTERN enum MHD_Bool 1918_MHD_EXTERN enum MHD_Bool
1906MHD_daemon_tcp_fastopen (struct MHD_Daemon *daemon, 1919MHD_daemon_tcp_fastopen (struct MHD_Daemon *daemon,
1907 enum MHD_FastOpenMethod fom, 1920 enum MHD_FastOpenMethod fom,
1908 unsigned int queue_length) 1921 unsigned int queue_length)
1909 MHD_NONNULL(1); 1922MHD_NONNULL (1);
1910 1923
1911 1924
1912/** 1925/**
@@ -1958,9 +1971,9 @@ enum MHD_AddressFamily
1958 */ 1971 */
1959_MHD_EXTERN void 1972_MHD_EXTERN void
1960MHD_daemon_bind_port (struct MHD_Daemon *daemon, 1973MHD_daemon_bind_port (struct MHD_Daemon *daemon,
1961 enum MHD_AddressFamily af, 1974 enum MHD_AddressFamily af,
1962 uint16_t port) 1975 uint16_t port)
1963 MHD_NONNULL(1); 1976MHD_NONNULL (1);
1964 1977
1965 1978
1966/** 1979/**
@@ -1974,9 +1987,9 @@ MHD_daemon_bind_port (struct MHD_Daemon *daemon,
1974 */ 1987 */
1975_MHD_EXTERN void 1988_MHD_EXTERN void
1976MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon, 1989MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon,
1977 const struct sockaddr *sa, 1990 const struct sockaddr *sa,
1978 size_t sa_len) 1991 size_t sa_len)
1979 MHD_NONNULL(1); 1992MHD_NONNULL (1);
1980 1993
1981 1994
1982/** 1995/**
@@ -1988,8 +2001,8 @@ MHD_daemon_bind_socket_address (struct MHD_Daemon *daemon,
1988 */ 2001 */
1989_MHD_EXTERN void 2002_MHD_EXTERN void
1990MHD_daemon_listen_backlog (struct MHD_Daemon *daemon, 2003MHD_daemon_listen_backlog (struct MHD_Daemon *daemon,
1991 int listen_backlog) 2004 int listen_backlog)
1992 MHD_NONNULL(1); 2005MHD_NONNULL (1);
1993 2006
1994 2007
1995/** 2008/**
@@ -2004,7 +2017,7 @@ MHD_daemon_listen_backlog (struct MHD_Daemon *daemon,
2004 */ 2017 */
2005_MHD_EXTERN void 2018_MHD_EXTERN void
2006MHD_daemon_listen_allow_address_reuse (struct MHD_Daemon *daemon) 2019MHD_daemon_listen_allow_address_reuse (struct MHD_Daemon *daemon)
2007 MHD_NONNULL(1); 2020MHD_NONNULL (1);
2008 2021
2009 2022
2010/** 2023/**
@@ -2023,8 +2036,8 @@ MHD_daemon_listen_allow_address_reuse (struct MHD_Daemon *daemon)
2023 */ 2036 */
2024_MHD_EXTERN void 2037_MHD_EXTERN void
2025MHD_daemon_listen_socket (struct MHD_Daemon *daemon, 2038MHD_daemon_listen_socket (struct MHD_Daemon *daemon,
2026 MHD_socket listen_socket) 2039 MHD_socket listen_socket)
2027 MHD_NONNULL(1); 2040MHD_NONNULL (1);
2028 2041
2029 2042
2030/** 2043/**
@@ -2064,8 +2077,8 @@ enum MHD_EventLoopSyscall
2064 */ 2077 */
2065_MHD_EXTERN enum MHD_Bool 2078_MHD_EXTERN enum MHD_Bool
2066MHD_daemon_event_loop (struct MHD_Daemon *daemon, 2079MHD_daemon_event_loop (struct MHD_Daemon *daemon,
2067 enum MHD_EventLoopSyscall els) 2080 enum MHD_EventLoopSyscall els)
2068 MHD_NONNULL(1); 2081MHD_NONNULL (1);
2069 2082
2070 2083
2071/** 2084/**
@@ -2109,8 +2122,8 @@ enum MHD_ProtocolStrictLevel
2109 */ 2122 */
2110_MHD_EXTERN void 2123_MHD_EXTERN void
2111MHD_daemon_protocol_strict_level (struct MHD_Daemon *daemon, 2124MHD_daemon_protocol_strict_level (struct MHD_Daemon *daemon,
2112 enum MHD_ProtocolStrictLevel sl) 2125 enum MHD_ProtocolStrictLevel sl)
2113 MHD_NONNULL(1); 2126MHD_NONNULL (1);
2114 2127
2115 2128
2116/** 2129/**
@@ -2121,7 +2134,7 @@ MHD_daemon_protocol_strict_level (struct MHD_Daemon *daemon,
2121 */ 2134 */
2122_MHD_EXTERN void 2135_MHD_EXTERN void
2123MHD_daemon_enable_shoutcast (struct MHD_Daemon *daemon) 2136MHD_daemon_enable_shoutcast (struct MHD_Daemon *daemon)
2124 MHD_NONNULL(1); 2137MHD_NONNULL (1);
2125 2138
2126 2139
2127/** 2140/**
@@ -2141,9 +2154,9 @@ MHD_daemon_enable_shoutcast (struct MHD_Daemon *daemon)
2141 */ 2154 */
2142_MHD_EXTERN enum MHD_StatusCode 2155_MHD_EXTERN enum MHD_StatusCode
2143MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon, 2156MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
2144 const char *tls_backend, 2157 const char *tls_backend,
2145 const char *ciphers) 2158 const char *ciphers)
2146 MHD_NONNULL(1); 2159MHD_NONNULL (1);
2147 2160
2148 2161
2149/** 2162/**
@@ -2160,10 +2173,10 @@ MHD_daemon_set_tls_backend (struct MHD_Daemon *daemon,
2160 */ 2173 */
2161_MHD_EXTERN enum MHD_StatusCode 2174_MHD_EXTERN enum MHD_StatusCode
2162MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon, 2175MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon,
2163 const char *mem_key, 2176 const char *mem_key,
2164 const char *mem_cert, 2177 const char *mem_cert,
2165 const char *pass) 2178 const char *pass)
2166 MHD_NONNULL(1,2,3); 2179MHD_NONNULL (1,2,3);
2167 2180
2168 2181
2169/** 2182/**
@@ -2176,8 +2189,8 @@ MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon,
2176 */ 2189 */
2177_MHD_EXTERN enum MHD_StatusCode 2190_MHD_EXTERN enum MHD_StatusCode
2178MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon, 2191MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
2179 const char *dh) 2192 const char *dh)
2180 MHD_NONNULL(1); 2193MHD_NONNULL (1);
2181 2194
2182 2195
2183/** 2196/**
@@ -2190,14 +2203,14 @@ MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
2190 * @param[out] psk to be set to the pre-shared-key; should be allocated with malloc(), 2203 * @param[out] psk to be set to the pre-shared-key; should be allocated with malloc(),
2191 * will be freed by MHD 2204 * will be freed by MHD
2192 * @param[out] psk_size to be set to the number of bytes in @a psk 2205 * @param[out] psk_size to be set to the number of bytes in @a psk
2193 * @return 0 on success, -1 on errors 2206 * @return 0 on success, -1 on errors
2194 */ 2207 */
2195typedef int 2208typedef int
2196(*MHD_PskServerCredentialsCallback)(void *cls, 2209(*MHD_PskServerCredentialsCallback)(void *cls,
2197 const struct MHD_Connection *connection, 2210 const struct MHD_Connection *connection,
2198 const char *username, 2211 const char *username,
2199 void **psk, 2212 void **psk,
2200 size_t *psk_size); 2213 size_t *psk_size);
2201 2214
2202 2215
2203/** 2216/**
@@ -2210,9 +2223,9 @@ typedef int
2210 */ 2223 */
2211_MHD_EXTERN enum MHD_StatusCode 2224_MHD_EXTERN enum MHD_StatusCode
2212MHD_daemon_set_tls_psk_callback (struct MHD_Daemon *daemon, 2225MHD_daemon_set_tls_psk_callback (struct MHD_Daemon *daemon,
2213 MHD_PskServerCredentialsCallback psk_cb, 2226 MHD_PskServerCredentialsCallback psk_cb,
2214 void *psk_cb_cls) 2227 void *psk_cb_cls)
2215 MHD_NONNULL(1); 2228MHD_NONNULL (1);
2216 2229
2217 2230
2218/** 2231/**
@@ -2225,8 +2238,8 @@ MHD_daemon_set_tls_psk_callback (struct MHD_Daemon *daemon,
2225 */ 2238 */
2226_MHD_EXTERN enum MHD_StatusCode 2239_MHD_EXTERN enum MHD_StatusCode
2227MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon, 2240MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
2228 const char *mem_trust) 2241 const char *mem_trust)
2229 MHD_NONNULL(1); 2242MHD_NONNULL (1);
2230 2243
2231 2244
2232/** 2245/**
@@ -2238,8 +2251,8 @@ MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
2238 */ 2251 */
2239_MHD_EXTERN enum MHD_StatusCode 2252_MHD_EXTERN enum MHD_StatusCode
2240MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon, 2253MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
2241 int gnutls_credentials) 2254 int gnutls_credentials)
2242 MHD_NONNULL(1); 2255MHD_NONNULL (1);
2243 2256
2244 2257
2245/** 2258/**
@@ -2261,8 +2274,8 @@ MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
2261 */ 2274 */
2262_MHD_EXTERN enum MHD_StatusCode 2275_MHD_EXTERN enum MHD_StatusCode
2263MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon, 2276MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon,
2264 void *cb) 2277 void *cb)
2265 MHD_NONNULL(1); 2278MHD_NONNULL (1);
2266 2279
2267 2280
2268/** 2281/**
@@ -2308,7 +2321,7 @@ enum MHD_ThreadingMode
2308 * 2321 *
2309 * @return an `enum MHD_ThreadingMode` for a thread pool of size @a n 2322 * @return an `enum MHD_ThreadingMode` for a thread pool of size @a n
2310 */ 2323 */
2311#define MHD_TM_THREAD_POOL(n) ((enum MHD_ThreadingMode)(n)) 2324#define MHD_TM_THREAD_POOL(n) ((enum MHD_ThreadingMode) (n))
2312 2325
2313 2326
2314/** 2327/**
@@ -2320,8 +2333,8 @@ enum MHD_ThreadingMode
2320 */ 2333 */
2321_MHD_EXTERN void 2334_MHD_EXTERN void
2322MHD_daemon_threading_mode (struct MHD_Daemon *daemon, 2335MHD_daemon_threading_mode (struct MHD_Daemon *daemon,
2323 enum MHD_ThreadingMode tm) 2336 enum MHD_ThreadingMode tm)
2324 MHD_NONNULL(1); 2337MHD_NONNULL (1);
2325 2338
2326 2339
2327/** 2340/**
@@ -2334,9 +2347,9 @@ MHD_daemon_threading_mode (struct MHD_Daemon *daemon,
2334 * @return #MHD_YES if connection is allowed, #MHD_NO if not 2347 * @return #MHD_YES if connection is allowed, #MHD_NO if not
2335 */ 2348 */
2336typedef enum MHD_Bool 2349typedef enum MHD_Bool
2337(*MHD_AcceptPolicyCallback) (void *cls, 2350(*MHD_AcceptPolicyCallback)(void *cls,
2338 const struct sockaddr *addr, 2351 const struct sockaddr *addr,
2339 size_t addrlen); 2352 size_t addrlen);
2340 2353
2341 2354
2342/** 2355/**
@@ -2350,9 +2363,9 @@ typedef enum MHD_Bool
2350 */ 2363 */
2351_MHD_EXTERN void 2364_MHD_EXTERN void
2352MHD_daemon_accept_policy (struct MHD_Daemon *daemon, 2365MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
2353 MHD_AcceptPolicyCallback apc, 2366 MHD_AcceptPolicyCallback apc,
2354 void *apc_cls) 2367 void *apc_cls)
2355 MHD_NONNULL(1); 2368MHD_NONNULL (1);
2356 2369
2357 2370
2358/** 2371/**
@@ -2367,8 +2380,8 @@ MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
2367 */ 2380 */
2368typedef void * 2381typedef void *
2369(*MHD_EarlyUriLogCallback)(void *cls, 2382(*MHD_EarlyUriLogCallback)(void *cls,
2370 const char *uri, 2383 const char *uri,
2371 struct MHD_Request *request); 2384 struct MHD_Request *request);
2372 2385
2373 2386
2374/** 2387/**
@@ -2382,9 +2395,9 @@ typedef void *
2382 */ 2395 */
2383_MHD_EXTERN void 2396_MHD_EXTERN void
2384MHD_daemon_set_early_uri_logger (struct MHD_Daemon *daemon, 2397MHD_daemon_set_early_uri_logger (struct MHD_Daemon *daemon,
2385 MHD_EarlyUriLogCallback cb, 2398 MHD_EarlyUriLogCallback cb,
2386 void *cb_cls) 2399 void *cb_cls)
2387 MHD_NONNULL(1); 2400MHD_NONNULL (1);
2388 2401
2389 2402
2390/** 2403/**
@@ -2431,8 +2444,8 @@ enum MHD_ConnectionNotificationCode
2431 */ 2444 */
2432typedef void 2445typedef void
2433(*MHD_NotifyConnectionCallback) (void *cls, 2446(*MHD_NotifyConnectionCallback) (void *cls,
2434 struct MHD_Connection *connection, 2447 struct MHD_Connection *connection,
2435 enum MHD_ConnectionNotificationCode toe); 2448 enum MHD_ConnectionNotificationCode toe);
2436 2449
2437 2450
2438/** 2451/**
@@ -2445,9 +2458,9 @@ typedef void
2445 */ 2458 */
2446_MHD_EXTERN void 2459_MHD_EXTERN void
2447MHD_daemon_set_notify_connection (struct MHD_Daemon *daemon, 2460MHD_daemon_set_notify_connection (struct MHD_Daemon *daemon,
2448 MHD_NotifyConnectionCallback ncc, 2461 MHD_NotifyConnectionCallback ncc,
2449 void *ncc_cls) 2462 void *ncc_cls)
2450 MHD_NONNULL(1); 2463MHD_NONNULL (1);
2451 2464
2452 2465
2453/** 2466/**
@@ -2463,9 +2476,9 @@ MHD_daemon_set_notify_connection (struct MHD_Daemon *daemon,
2463 */ 2476 */
2464_MHD_EXTERN void 2477_MHD_EXTERN void
2465MHD_daemon_connection_memory_limit (struct MHD_Daemon *daemon, 2478MHD_daemon_connection_memory_limit (struct MHD_Daemon *daemon,
2466 size_t memory_limit_b, 2479 size_t memory_limit_b,
2467 size_t memory_increment_b) 2480 size_t memory_increment_b)
2468 MHD_NONNULL(1); 2481MHD_NONNULL (1);
2469 2482
2470 2483
2471/** 2484/**
@@ -2478,8 +2491,8 @@ MHD_daemon_connection_memory_limit (struct MHD_Daemon *daemon,
2478 */ 2491 */
2479_MHD_EXTERN void 2492_MHD_EXTERN void
2480MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon, 2493MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon,
2481 size_t stack_limit_b) 2494 size_t stack_limit_b)
2482 MHD_NONNULL(1); 2495MHD_NONNULL (1);
2483 2496
2484 2497
2485/** 2498/**
@@ -2499,9 +2512,9 @@ MHD_daemon_thread_stack_size (struct MHD_Daemon *daemon,
2499 */ 2512 */
2500_MHD_EXTERN void 2513_MHD_EXTERN void
2501MHD_daemon_connection_limits (struct MHD_Daemon *daemon, 2514MHD_daemon_connection_limits (struct MHD_Daemon *daemon,
2502 unsigned int global_connection_limit, 2515 unsigned int global_connection_limit,
2503 unsigned int ip_connection_limit) 2516 unsigned int ip_connection_limit)
2504 MHD_NONNULL(1); 2517MHD_NONNULL (1);
2505 2518
2506 2519
2507/** 2520/**
@@ -2514,8 +2527,8 @@ MHD_daemon_connection_limits (struct MHD_Daemon *daemon,
2514 */ 2527 */
2515_MHD_EXTERN void 2528_MHD_EXTERN void
2516MHD_daemon_connection_default_timeout (struct MHD_Daemon *daemon, 2529MHD_daemon_connection_default_timeout (struct MHD_Daemon *daemon,
2517 unsigned int timeout_s) 2530 unsigned int timeout_s)
2518 MHD_NONNULL(1); 2531MHD_NONNULL (1);
2519 2532
2520 2533
2521/** 2534/**
@@ -2532,8 +2545,8 @@ MHD_daemon_connection_default_timeout (struct MHD_Daemon *daemon,
2532 */ 2545 */
2533typedef size_t 2546typedef size_t
2534(*MHD_UnescapeCallback) (void *cls, 2547(*MHD_UnescapeCallback) (void *cls,
2535 struct MHD_Request *req, 2548 struct MHD_Request *req,
2536 char *s); 2549 char *s);
2537 2550
2538 2551
2539/** 2552/**
@@ -2549,9 +2562,9 @@ typedef size_t
2549 */ 2562 */
2550_MHD_EXTERN void 2563_MHD_EXTERN void
2551MHD_daemon_unescape_cb (struct MHD_Daemon *daemon, 2564MHD_daemon_unescape_cb (struct MHD_Daemon *daemon,
2552 MHD_UnescapeCallback unescape_cb, 2565 MHD_UnescapeCallback unescape_cb,
2553 void *unescape_cb_cls) 2566 void *unescape_cb_cls)
2554 MHD_NONNULL(1); 2567MHD_NONNULL (1);
2555 2568
2556 2569
2557/** 2570/**
@@ -2565,9 +2578,9 @@ MHD_daemon_unescape_cb (struct MHD_Daemon *daemon,
2565 */ 2578 */
2566_MHD_EXTERN void 2579_MHD_EXTERN void
2567MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon, 2580MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon,
2568 size_t buf_size, 2581 size_t buf_size,
2569 const void *buf) 2582 const void *buf)
2570 MHD_NONNULL(1,3); 2583MHD_NONNULL (1,3);
2571 2584
2572 2585
2573/** 2586/**
@@ -2579,8 +2592,8 @@ MHD_daemon_digest_auth_random (struct MHD_Daemon *daemon,
2579 */ 2592 */
2580_MHD_EXTERN enum MHD_StatusCode 2593_MHD_EXTERN enum MHD_StatusCode
2581MHD_daemon_digest_auth_nc_length (struct MHD_Daemon *daemon, 2594MHD_daemon_digest_auth_nc_length (struct MHD_Daemon *daemon,
2582 size_t nc_length) 2595 size_t nc_length)
2583 MHD_NONNULL(1); 2596MHD_NONNULL (1);
2584 2597
2585 2598
2586/* ********************* connection options ************** */ 2599/* ********************* connection options ************** */
@@ -2596,8 +2609,8 @@ MHD_daemon_digest_auth_nc_length (struct MHD_Daemon *daemon,
2596 */ 2609 */
2597_MHD_EXTERN void 2610_MHD_EXTERN void
2598MHD_connection_set_timeout (struct MHD_Connection *connection, 2611MHD_connection_set_timeout (struct MHD_Connection *connection,
2599 unsigned int timeout_s) 2612 unsigned int timeout_s)
2600 MHD_NONNULL(1); 2613MHD_NONNULL (1);
2601 2614
2602 2615
2603/* **************** Request handling functions ***************** */ 2616/* **************** Request handling functions ***************** */
@@ -2678,10 +2691,10 @@ typedef int
2678 */ 2691 */
2679_MHD_EXTERN unsigned int 2692_MHD_EXTERN unsigned int
2680MHD_request_get_values (struct MHD_Request *request, 2693MHD_request_get_values (struct MHD_Request *request,
2681 enum MHD_ValueKind kind, 2694 enum MHD_ValueKind kind,
2682 MHD_KeyValueIterator iterator, 2695 MHD_KeyValueIterator iterator,
2683 void *iterator_cls) 2696 void *iterator_cls)
2684 MHD_NONNULL(1); 2697MHD_NONNULL (1);
2685 2698
2686 2699
2687/** 2700/**
@@ -2711,10 +2724,10 @@ MHD_request_get_values (struct MHD_Request *request,
2711 */ 2724 */
2712_MHD_EXTERN enum MHD_Bool 2725_MHD_EXTERN enum MHD_Bool
2713MHD_request_set_value (struct MHD_Request *request, 2726MHD_request_set_value (struct MHD_Request *request,
2714 enum MHD_ValueKind kind, 2727 enum MHD_ValueKind kind,
2715 const char *key, 2728 const char *key,
2716 const char *value) 2729 const char *value)
2717 MHD_NONNULL(1,3,4); 2730MHD_NONNULL (1,3,4);
2718 2731
2719 2732
2720/** 2733/**
@@ -2729,9 +2742,9 @@ MHD_request_set_value (struct MHD_Request *request,
2729 */ 2742 */
2730_MHD_EXTERN const char * 2743_MHD_EXTERN const char *
2731MHD_request_lookup_value (struct MHD_Request *request, 2744MHD_request_lookup_value (struct MHD_Request *request,
2732 enum MHD_ValueKind kind, 2745 enum MHD_ValueKind kind,
2733 const char *key) 2746 const char *key)
2734 MHD_NONNULL(1); 2747MHD_NONNULL (1);
2735 2748
2736 2749
2737 2750
@@ -2741,7 +2754,8 @@ MHD_request_lookup_value (struct MHD_Request *request,
2741 * @{ 2754 * @{
2742 */ 2755 */
2743/* See http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml */ 2756/* See http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml */
2744enum MHD_HTTP_StatusCode { 2757enum MHD_HTTP_StatusCode
2758{
2745 MHD_HTTP_CONTINUE = 100, 2759 MHD_HTTP_CONTINUE = 100,
2746 MHD_HTTP_SWITCHING_PROTOCOLS = 101, 2760 MHD_HTTP_SWITCHING_PROTOCOLS = 101,
2747 MHD_HTTP_PROCESSING = 102, 2761 MHD_HTTP_PROCESSING = 102,
@@ -2777,7 +2791,9 @@ enum MHD_HTTP_StatusCode {
2777 MHD_HTTP_NOT_ACCEPTABLE = 406, 2791 MHD_HTTP_NOT_ACCEPTABLE = 406,
2778/** @deprecated */ 2792/** @deprecated */
2779#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \ 2793#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
2780 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") MHD_HTTP_NOT_ACCEPTABLE 2794 _MHD_DEPR_IN_MACRO ( \
2795 "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") \
2796 MHD_HTTP_NOT_ACCEPTABLE
2781 MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED = 407, 2797 MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED = 407,
2782 MHD_HTTP_REQUEST_TIMEOUT = 408, 2798 MHD_HTTP_REQUEST_TIMEOUT = 408,
2783 MHD_HTTP_CONFLICT = 409, 2799 MHD_HTTP_CONFLICT = 409,
@@ -2787,16 +2803,22 @@ enum MHD_HTTP_StatusCode {
2787 MHD_HTTP_PAYLOAD_TOO_LARGE = 413, 2803 MHD_HTTP_PAYLOAD_TOO_LARGE = 413,
2788/** @deprecated */ 2804/** @deprecated */
2789#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \ 2805#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
2790 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") MHD_HTTP_PAYLOAD_TOO_LARGE 2806 _MHD_DEPR_IN_MACRO ( \
2807 "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") \
2808 MHD_HTTP_PAYLOAD_TOO_LARGE
2791 MHD_HTTP_URI_TOO_LONG = 414, 2809 MHD_HTTP_URI_TOO_LONG = 414,
2792/** @deprecated */ 2810/** @deprecated */
2793#define MHD_HTTP_REQUEST_URI_TOO_LONG \ 2811#define MHD_HTTP_REQUEST_URI_TOO_LONG \
2794 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") MHD_HTTP_URI_TOO_LONG 2812 _MHD_DEPR_IN_MACRO ( \
2813 "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") \
2814 MHD_HTTP_URI_TOO_LONG
2795 MHD_HTTP_UNSUPPORTED_MEDIA_TYPE = 415, 2815 MHD_HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
2796 MHD_HTTP_RANGE_NOT_SATISFIABLE = 416, 2816 MHD_HTTP_RANGE_NOT_SATISFIABLE = 416,
2797/** @deprecated */ 2817/** @deprecated */
2798#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \ 2818#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
2799 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") MHD_HTTP_RANGE_NOT_SATISFIABLE 2819 _MHD_DEPR_IN_MACRO ( \
2820 "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") \
2821 MHD_HTTP_RANGE_NOT_SATISFIABLE
2800 MHD_HTTP_EXPECTATION_FAILED = 417, 2822 MHD_HTTP_EXPECTATION_FAILED = 417,
2801 2823
2802 MHD_HTTP_MISDIRECTED_REQUEST = 421, 2824 MHD_HTTP_MISDIRECTED_REQUEST = 421,
@@ -2903,7 +2925,7 @@ MHD_action_suspend (void);
2903 */ 2925 */
2904_MHD_EXTERN void 2926_MHD_EXTERN void
2905MHD_request_resume (struct MHD_Request *request) 2927MHD_request_resume (struct MHD_Request *request)
2906 MHD_NONNULL(1); 2928MHD_NONNULL (1);
2907 2929
2908 2930
2909/* **************** Response manipulation functions ***************** */ 2931/* **************** Response manipulation functions ***************** */
@@ -2936,8 +2958,8 @@ struct MHD_Response;
2936 */ 2958 */
2937_MHD_EXTERN const struct MHD_Action * 2959_MHD_EXTERN const struct MHD_Action *
2938MHD_action_from_response (struct MHD_Response *response, 2960MHD_action_from_response (struct MHD_Response *response,
2939 enum MHD_Bool destroy_after_use) 2961 enum MHD_Bool destroy_after_use)
2940 MHD_NONNULL(1); 2962MHD_NONNULL (1);
2941 2963
2942 2964
2943/** 2965/**
@@ -2949,7 +2971,7 @@ MHD_action_from_response (struct MHD_Response *response,
2949 */ 2971 */
2950_MHD_EXTERN void 2972_MHD_EXTERN void
2951MHD_response_option_v10_only (struct MHD_Response *response) 2973MHD_response_option_v10_only (struct MHD_Response *response)
2952 MHD_NONNULL(1); 2974MHD_NONNULL (1);
2953 2975
2954 2976
2955/** 2977/**
@@ -3023,8 +3045,8 @@ enum MHD_RequestTerminationCode
3023 */ 3045 */
3024typedef void 3046typedef void
3025(*MHD_RequestTerminationCallback) (void *cls, 3047(*MHD_RequestTerminationCallback) (void *cls,
3026 enum MHD_RequestTerminationCode toe, 3048 enum MHD_RequestTerminationCode toe,
3027 void *request_context); 3049 void *request_context);
3028 3050
3029 3051
3030/** 3052/**
@@ -3037,9 +3059,10 @@ typedef void
3037 */ 3059 */
3038_MHD_EXTERN void 3060_MHD_EXTERN void
3039MHD_response_option_termination_callback (struct MHD_Response *response, 3061MHD_response_option_termination_callback (struct MHD_Response *response,
3040 MHD_RequestTerminationCallback termination_cb, 3062 MHD_RequestTerminationCallback
3041 void *termination_cb_cls) 3063 termination_cb,
3042 MHD_NONNULL(1); 3064 void *termination_cb_cls)
3065MHD_NONNULL (1);
3043 3066
3044 3067
3045/** 3068/**
@@ -3124,11 +3147,11 @@ typedef void
3124 */ 3147 */
3125_MHD_EXTERN struct MHD_Response * 3148_MHD_EXTERN struct MHD_Response *
3126MHD_response_from_callback (enum MHD_HTTP_StatusCode sc, 3149MHD_response_from_callback (enum MHD_HTTP_StatusCode sc,
3127 uint64_t size, 3150 uint64_t size,
3128 size_t block_size, 3151 size_t block_size,
3129 MHD_ContentReaderCallback crc, 3152 MHD_ContentReaderCallback crc,
3130 void *crc_cls, 3153 void *crc_cls,
3131 MHD_ContentReaderFreeCallback crfc); 3154 MHD_ContentReaderFreeCallback crfc);
3132 3155
3133 3156
3134/** 3157/**
@@ -3181,9 +3204,9 @@ enum MHD_ResponseMemoryMode
3181 */ 3204 */
3182_MHD_EXTERN struct MHD_Response * 3205_MHD_EXTERN struct MHD_Response *
3183MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc, 3206MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc,
3184 size_t size, 3207 size_t size,
3185 void *buffer, 3208 void *buffer,
3186 enum MHD_ResponseMemoryMode mode); 3209 enum MHD_ResponseMemoryMode mode);
3187 3210
3188 3211
3189/** 3212/**
@@ -3206,9 +3229,9 @@ MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc,
3206 */ 3229 */
3207_MHD_EXTERN struct MHD_Response * 3230_MHD_EXTERN struct MHD_Response *
3208MHD_response_from_fd (enum MHD_HTTP_StatusCode sc, 3231MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
3209 int fd, 3232 int fd,
3210 uint64_t offset, 3233 uint64_t offset,
3211 uint64_t size); 3234 uint64_t size);
3212 3235
3213 3236
3214/** 3237/**
@@ -3255,9 +3278,9 @@ struct MHD_UpgradeResponseHandle;
3255 */ 3278 */
3256_MHD_EXTERN enum MHD_Bool 3279_MHD_EXTERN enum MHD_Bool
3257MHD_upgrade_operation (struct MHD_UpgradeResponseHandle *urh, 3280MHD_upgrade_operation (struct MHD_UpgradeResponseHandle *urh,
3258 enum MHD_UpgradeOperation operation, 3281 enum MHD_UpgradeOperation operation,
3259 ...) 3282 ...)
3260 MHD_NONNULL(1); 3283MHD_NONNULL (1);
3261 3284
3262 3285
3263/** 3286/**
@@ -3349,8 +3372,8 @@ typedef void
3349 */ 3372 */
3350_MHD_EXTERN struct MHD_Response * 3373_MHD_EXTERN struct MHD_Response *
3351MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, 3374MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
3352 void *upgrade_handler_cls) 3375 void *upgrade_handler_cls)
3353 MHD_NONNULL(1); 3376MHD_NONNULL (1);
3354 3377
3355 3378
3356/** 3379/**
@@ -3364,7 +3387,7 @@ MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
3364 */ 3387 */
3365_MHD_EXTERN void 3388_MHD_EXTERN void
3366MHD_response_queue_for_destroy (struct MHD_Response *response) 3389MHD_response_queue_for_destroy (struct MHD_Response *response)
3367 MHD_NONNULL(1); 3390MHD_NONNULL (1);
3368 3391
3369 3392
3370/** 3393/**
@@ -3380,8 +3403,8 @@ MHD_response_queue_for_destroy (struct MHD_Response *response)
3380_MHD_EXTERN enum MHD_Bool 3403_MHD_EXTERN enum MHD_Bool
3381MHD_response_add_header (struct MHD_Response *response, 3404MHD_response_add_header (struct MHD_Response *response,
3382 const char *header, 3405 const char *header,
3383 const char *content) 3406 const char *content)
3384 MHD_NONNULL(1,2,3); 3407MHD_NONNULL (1,2,3);
3385 3408
3386 3409
3387/** 3410/**
@@ -3398,7 +3421,7 @@ _MHD_EXTERN enum MHD_Bool
3398MHD_response_add_trailer (struct MHD_Response *response, 3421MHD_response_add_trailer (struct MHD_Response *response,
3399 const char *footer, 3422 const char *footer,
3400 const char *content) 3423 const char *content)
3401 MHD_NONNULL(1,2,3); 3424MHD_NONNULL (1,2,3);
3402 3425
3403 3426
3404/** 3427/**
@@ -3413,8 +3436,8 @@ MHD_response_add_trailer (struct MHD_Response *response,
3413_MHD_EXTERN enum MHD_Bool 3436_MHD_EXTERN enum MHD_Bool
3414MHD_response_del_header (struct MHD_Response *response, 3437MHD_response_del_header (struct MHD_Response *response,
3415 const char *header, 3438 const char *header,
3416 const char *content) 3439 const char *content)
3417 MHD_NONNULL(1,2,3); 3440MHD_NONNULL (1,2,3);
3418 3441
3419 3442
3420/** 3443/**
@@ -3430,8 +3453,8 @@ MHD_response_del_header (struct MHD_Response *response,
3430_MHD_EXTERN unsigned int 3453_MHD_EXTERN unsigned int
3431MHD_response_get_headers (struct MHD_Response *response, 3454MHD_response_get_headers (struct MHD_Response *response,
3432 MHD_KeyValueIterator iterator, 3455 MHD_KeyValueIterator iterator,
3433 void *iterator_cls) 3456 void *iterator_cls)
3434 MHD_NONNULL(1); 3457MHD_NONNULL (1);
3435 3458
3436 3459
3437/** 3460/**
@@ -3444,8 +3467,8 @@ MHD_response_get_headers (struct MHD_Response *response,
3444 */ 3467 */
3445_MHD_EXTERN const char * 3468_MHD_EXTERN const char *
3446MHD_response_get_header (struct MHD_Response *response, 3469MHD_response_get_header (struct MHD_Response *response,
3447 const char *key) 3470 const char *key)
3448 MHD_NONNULL(1,2); 3471MHD_NONNULL (1,2);
3449 3472
3450 3473
3451/* ************Upload and PostProcessor functions ********************** */ 3474/* ************Upload and PostProcessor functions ********************** */
@@ -3480,8 +3503,8 @@ MHD_action_continue (void);
3480 */ 3503 */
3481typedef const struct MHD_Action * 3504typedef const struct MHD_Action *
3482(*MHD_UploadCallback) (void *cls, 3505(*MHD_UploadCallback) (void *cls,
3483 const char *upload_data, 3506 const char *upload_data,
3484 size_t *upload_data_size); 3507 size_t *upload_data_size);
3485 3508
3486 3509
3487/** 3510/**
@@ -3494,8 +3517,8 @@ typedef const struct MHD_Action *
3494 */ 3517 */
3495_MHD_EXTERN const struct MHD_Action * 3518_MHD_EXTERN const struct MHD_Action *
3496MHD_action_process_upload (MHD_UploadCallback uc, 3519MHD_action_process_upload (MHD_UploadCallback uc,
3497 void *uc_cls) 3520 void *uc_cls)
3498 MHD_NONNULL(1); 3521MHD_NONNULL (1);
3499 3522
3500 3523
3501/** 3524/**
@@ -3559,9 +3582,9 @@ typedef const struct MHD_Action *
3559 */ 3582 */
3560_MHD_EXTERN const struct MHD_Action * 3583_MHD_EXTERN const struct MHD_Action *
3561MHD_action_parse_post (size_t buffer_size, 3584MHD_action_parse_post (size_t buffer_size,
3562 MHD_PostDataIterator iter, 3585 MHD_PostDataIterator iter,
3563 void *iter_cls) 3586 void *iter_cls)
3564 MHD_NONNULL(2); 3587MHD_NONNULL (2);
3565 3588
3566 3589
3567 3590
@@ -3730,10 +3753,10 @@ union MHD_ConnectionInformation
3730 */ 3753 */
3731_MHD_EXTERN enum MHD_Bool 3754_MHD_EXTERN enum MHD_Bool
3732MHD_connection_get_information_sz (struct MHD_Connection *connection, 3755MHD_connection_get_information_sz (struct MHD_Connection *connection,
3733 enum MHD_ConnectionInformationType info_type, 3756 enum MHD_ConnectionInformationType info_type,
3734 union MHD_ConnectionInformation *return_value, 3757 union MHD_ConnectionInformation *return_value,
3735 size_t return_value_size) 3758 size_t return_value_size)
3736 MHD_NONNULL(1,3); 3759MHD_NONNULL (1,3);
3737 3760
3738 3761
3739/** 3762/**
@@ -3750,7 +3773,8 @@ MHD_connection_get_information_sz (struct MHD_Connection *connection,
3750#define MHD_connection_get_information(connection, \ 3773#define MHD_connection_get_information(connection, \
3751 info_type, \ 3774 info_type, \
3752 return_value) \ 3775 return_value) \
3753 MHD_connection_get_information_sz ((connection),(info_type),(return_value),sizeof(union MHD_ConnectionInformation)) 3776 MHD_connection_get_information_sz ((connection),(info_type),(return_value), \
3777 sizeof(union MHD_ConnectionInformation))
3754 3778
3755 3779
3756/** 3780/**
@@ -3843,10 +3867,10 @@ enum MHD_RequestInformationType
3843 */ 3867 */
3844_MHD_EXTERN enum MHD_Bool 3868_MHD_EXTERN enum MHD_Bool
3845MHD_request_get_information_sz (struct MHD_Request *request, 3869MHD_request_get_information_sz (struct MHD_Request *request,
3846 enum MHD_RequestInformationType info_type, 3870 enum MHD_RequestInformationType info_type,
3847 union MHD_RequestInformation *return_value, 3871 union MHD_RequestInformation *return_value,
3848 size_t return_value_size) 3872 size_t return_value_size)
3849 MHD_NONNULL(1,3); 3873MHD_NONNULL (1,3);
3850 3874
3851 3875
3852/** 3876/**
@@ -3863,7 +3887,8 @@ MHD_request_get_information_sz (struct MHD_Request *request,
3863#define MHD_request_get_information (request, \ 3887#define MHD_request_get_information (request, \
3864 info_type, \ 3888 info_type, \
3865 return_value) \ 3889 return_value) \
3866 MHD_request_get_information_sz ((request), (info_type), (return_value), sizeof(union MHD_RequestInformation)) 3890 MHD_request_get_information_sz ((request), (info_type), (return_value), \
3891 sizeof(union MHD_RequestInformation))
3867 3892
3868 3893
3869/** 3894/**
@@ -3950,10 +3975,10 @@ union MHD_DaemonInformation
3950 */ 3975 */
3951_MHD_EXTERN enum MHD_Bool 3976_MHD_EXTERN enum MHD_Bool
3952MHD_daemon_get_information_sz (struct MHD_Daemon *daemon, 3977MHD_daemon_get_information_sz (struct MHD_Daemon *daemon,
3953 enum MHD_DaemonInformationType info_type, 3978 enum MHD_DaemonInformationType info_type,
3954 union MHD_DaemonInformation *return_value, 3979 union MHD_DaemonInformation *return_value,
3955 size_t return_value_size) 3980 size_t return_value_size)
3956 MHD_NONNULL(1,3); 3981MHD_NONNULL (1,3);
3957 3982
3958/** 3983/**
3959 * Obtain information about the given daemon. 3984 * Obtain information about the given daemon.
@@ -3969,7 +3994,8 @@ MHD_daemon_get_information_sz (struct MHD_Daemon *daemon,
3969#define MHD_daemon_get_information(daemon, \ 3994#define MHD_daemon_get_information(daemon, \
3970 info_type, \ 3995 info_type, \
3971 return_value) \ 3996 return_value) \
3972 MHD_daemon_get_information_sz((daemon), (info_type), (return_value), sizeof(union MHD_DaemonInformation)); 3997 MHD_daemon_get_information_sz ((daemon), (info_type), (return_value), \
3998 sizeof(union MHD_DaemonInformation));
3973 3999
3974 4000
3975/** 4001/**
@@ -4007,7 +4033,7 @@ typedef void
4007 */ 4033 */
4008_MHD_EXTERN void 4034_MHD_EXTERN void
4009MHD_set_panic_func (MHD_PanicCallback cb, 4035MHD_set_panic_func (MHD_PanicCallback cb,
4010 void *cls); 4036 void *cls);
4011 4037
4012 4038
4013/** 4039/**
@@ -4021,7 +4047,7 @@ MHD_set_panic_func (MHD_PanicCallback cb,
4021 */ 4047 */
4022_MHD_EXTERN size_t 4048_MHD_EXTERN size_t
4023MHD_http_unescape (char *val) 4049MHD_http_unescape (char *val)
4024 MHD_NONNULL(1); 4050MHD_NONNULL (1);
4025 4051
4026 4052
4027/** 4053/**