aboutsummaryrefslogtreecommitdiff
path: root/src/include/microhttpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r--src/include/microhttpd.h390
1 files changed, 217 insertions, 173 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index a678f399..4f8f685a 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -108,7 +108,7 @@ extern "C"
108#include <stdarg.h> 108#include <stdarg.h>
109#include <stdint.h> 109#include <stdint.h>
110#include <sys/types.h> 110#include <sys/types.h>
111#if !defined(_WIN32) || defined(__CYGWIN__) 111#if ! defined(_WIN32) || defined(__CYGWIN__)
112#include <unistd.h> 112#include <unistd.h>
113#include <sys/time.h> 113#include <sys/time.h>
114#include <sys/socket.h> 114#include <sys/socket.h>
@@ -116,14 +116,14 @@ extern "C"
116/* Declare POSIX-compatible names */ 116/* Declare POSIX-compatible names */
117#define _CRT_DECLARE_NONSTDC_NAMES 1 117#define _CRT_DECLARE_NONSTDC_NAMES 1
118#include <ws2tcpip.h> 118#include <ws2tcpip.h>
119#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED) 119#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
120#define _SSIZE_T_DEFINED 120#define _SSIZE_T_DEFINED
121typedef intptr_t ssize_t; 121typedef intptr_t ssize_t;
122#endif /* !_SSIZE_T_DEFINED */ 122#endif /* !_SSIZE_T_DEFINED */
123#endif /* _WIN32 && ! __CYGWIN__ */ 123#endif /* _WIN32 && ! __CYGWIN__ */
124#endif 124#endif
125 125
126#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET) 126#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
127/* Do not define __USE_W32_SOCKETS under Cygwin! */ 127/* Do not define __USE_W32_SOCKETS under Cygwin! */
128#error Cygwin with winsock fd_set is not supported 128#error Cygwin with winsock fd_set is not supported
129#endif 129#endif
@@ -182,7 +182,7 @@ typedef intptr_t ssize_t;
182/** 182/**
183 * MHD_socket is type for socket FDs 183 * MHD_socket is type for socket FDs
184 */ 184 */
185#if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) 185#if ! defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
186#define MHD_POSIX_SOCKETS 1 186#define MHD_POSIX_SOCKETS 1
187typedef int MHD_socket; 187typedef int MHD_socket;
188#define MHD_INVALID_SOCKET (-1) 188#define MHD_INVALID_SOCKET (-1)
@@ -207,30 +207,35 @@ typedef SOCKET MHD_socket;
207#endif /* MHD_NO_DEPRECATION */ 207#endif /* MHD_NO_DEPRECATION */
208 208
209#ifndef _MHD_DEPR_MACRO 209#ifndef _MHD_DEPR_MACRO
210#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500 210#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1500
211/* VS 2008 or later */ 211/* VS 2008 or later */
212/* Stringify macros */ 212/* Stringify macros */
213#define _MHD_INSTRMACRO(a) #a 213#define _MHD_INSTRMACRO(a) #a
214#define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a) 214#define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a)
215/* deprecation message */ 215/* deprecation message */
216#define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg)) 216#define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \
217#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 217 __LINE__) "): warning: " msg))
218#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
218#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) 219#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
219/* clang or GCC since 3.0 */ 220/* clang or GCC since 3.0 */
220#define _MHD_GCC_PRAG(x) _Pragma (#x) 221#define _MHD_GCC_PRAG(x) _Pragma (#x)
221#if (defined(__clang__) && (__clang_major__+0 >= 5 || \ 222#if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \
222 (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) || \ 223 (! defined(__apple_build_version__) && \
223 __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8) 224 (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \
225 3))))) || \
226 __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8)
224/* clang >= 3.3 (or XCode's clang >= 5.0) or 227/* clang >= 3.3 (or XCode's clang >= 5.0) or
225 GCC >= 4.8 */ 228 GCC >= 4.8 */
226#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg) 229#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg)
227#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 230#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
228#else /* older clang or GCC */ 231#else /* older clang or GCC */
229/* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */ 232/* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
230#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg) 233#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg)
231#if (defined(__clang__) && (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: clang >= 2.9, earlier versions not tested */ 234#if (defined(__clang__) && (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == \
235 2 && __clang_minor__ >= \
236 9))) /* FIXME: clang >= 2.9, earlier versions not tested */
232/* clang handles inline pragmas better than GCC */ 237/* clang handles inline pragmas better than GCC */
233#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 238#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
234#endif /* clang >= 2.9 */ 239#endif /* clang >= 2.9 */
235#endif /* older clang or GCC */ 240#endif /* older clang or GCC */
236/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ 241/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
@@ -247,17 +252,19 @@ typedef SOCKET MHD_socket;
247#endif /* !_MHD_DEPR_IN_MACRO */ 252#endif /* !_MHD_DEPR_IN_MACRO */
248 253
249#ifndef _MHD_DEPR_FUNC 254#ifndef _MHD_DEPR_FUNC
250#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400 255#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400
251/* VS 2005 or later */ 256/* VS 2005 or later */
252#define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg)) 257#define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg))
253#elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310 258#elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310
254/* VS .NET 2003 deprecation do not support custom messages */ 259/* VS .NET 2003 deprecation do not support custom messages */
255#define _MHD_DEPR_FUNC(msg) __declspec(deprecated) 260#define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
256#elif (__GNUC__+0 >= 5) || (defined (__clang__) && \ 261#elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \
257 (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: earlier versions not tested */ 262 (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \
263 9))) /* FIXME: earlier versions not tested */
258/* GCC >= 5.0 or clang >= 2.9 */ 264/* GCC >= 5.0 or clang >= 2.9 */
259#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg))) 265#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg)))
260#elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1) 266#elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \
267 __GNUC_MINOR__ + 0 >= 1)
261/* 3.1 <= GCC < 5.0 or clang < 2.9 */ 268/* 3.1 <= GCC < 5.0 or clang < 2.9 */
262/* old GCC-style deprecation do not support custom messages */ 269/* old GCC-style deprecation do not support custom messages */
263#define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__)) 270#define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
@@ -282,7 +289,8 @@ typedef SOCKET MHD_socket;
282#define MHD_LONG_LONG long long 289#define MHD_LONG_LONG long long
283#define MHD_UNSIGNED_LONG_LONG unsigned long long 290#define MHD_UNSIGNED_LONG_LONG unsigned long long
284#else /* MHD_LONG_LONG */ 291#else /* MHD_LONG_LONG */
285_MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG") 292_MHD_DEPR_MACRO (
293 "Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
286#endif 294#endif
287/** 295/**
288 * Format string for printing a variable of type #MHD_LONG_LONG. 296 * Format string for printing a variable of type #MHD_LONG_LONG.
@@ -295,14 +303,15 @@ _MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
295#define MHD_LONG_LONG_PRINTF "ll" 303#define MHD_LONG_LONG_PRINTF "ll"
296#define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu" 304#define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
297#else /* MHD_LONG_LONG_PRINTF */ 305#else /* MHD_LONG_LONG_PRINTF */
298_MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF") 306_MHD_DEPR_MACRO (
307 "Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
299#endif 308#endif
300 309
301 310
302/** 311/**
303 * Length of the binary output of the MD5 hash function. 312 * Length of the binary output of the MD5 hash function.
304 */ 313 */
305#define MHD_MD5_DIGEST_SIZE 16 314#define MHD_MD5_DIGEST_SIZE 16
306 315
307 316
308/** 317/**
@@ -463,27 +472,39 @@ _MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG
463/* Deprecated codes */ 472/* Deprecated codes */
464/** @deprecated */ 473/** @deprecated */
465#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \ 474#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
466 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") 406 475 _MHD_DEPR_IN_MACRO ( \
476 "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") \
477 406
467 478
468/** @deprecated */ 479/** @deprecated */
469#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \ 480#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
470 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") 413 481 _MHD_DEPR_IN_MACRO ( \
482 "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") \
483 413
471 484
472/** @deprecated */ 485/** @deprecated */
473#define MHD_HTTP_REQUEST_URI_TOO_LONG \ 486#define MHD_HTTP_REQUEST_URI_TOO_LONG \
474 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") 414 487 _MHD_DEPR_IN_MACRO ( \
488 "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") \
489 414
475 490
476/** @deprecated */ 491/** @deprecated */
477#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \ 492#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
478 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416 493 _MHD_DEPR_IN_MACRO ( \
494 "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") \
495 416
479 496
480/** @deprecated */ 497/** @deprecated */
481#define MHD_HTTP_UNORDERED_COLLECTION \ 498#define MHD_HTTP_UNORDERED_COLLECTION \
482 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") 425 499 _MHD_DEPR_IN_MACRO ( \
500 "Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") \
501 425
483 502
484/** @deprecated */ 503/** @deprecated */
485#define MHD_HTTP_NO_RESPONSE \ 504#define MHD_HTTP_NO_RESPONSE \
486 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for logs only") 444 505 _MHD_DEPR_IN_MACRO ( \
506 "Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for logs only") \
507 444
487 508
488 509
489/** @} */ /* end of group httpcode */ 510/** @} */ /* end of group httpcode */
@@ -504,7 +525,7 @@ MHD_get_reason_phrase_for (unsigned int code);
504 * with the SHOUTcast "ICY" line instad of "HTTP". 525 * with the SHOUTcast "ICY" line instad of "HTTP".
505 * @ingroup specialized 526 * @ingroup specialized
506 */ 527 */
507#define MHD_ICY_FLAG ((uint32_t)(((uint32_t)1) << 31)) 528#define MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31))
508 529
509/** 530/**
510 * @defgroup headers HTTP headers 531 * @defgroup headers HTTP headers
@@ -712,7 +733,8 @@ MHD_get_reason_phrase_for (unsigned int code);
712/* Standard. RFC6638 */ 733/* Standard. RFC6638 */
713#define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match" 734#define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
714/* Standard. RFC8473 */ 735/* Standard. RFC8473 */
715#define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID "Include-Referred-Token-Binding-ID" 736#define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID \
737 "Include-Referred-Token-Binding-ID"
716/* No category. RFC4229 */ 738/* No category. RFC4229 */
717#define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive" 739#define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
718/* No category. RFC4229 */ 740/* No category. RFC4229 */
@@ -776,7 +798,8 @@ MHD_get_reason_phrase_for (unsigned int code);
776/* Standard. RFC7469 */ 798/* Standard. RFC7469 */
777#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins" 799#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
778/* Standard. RFC7469 */ 800/* Standard. RFC7469 */
779#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY "Public-Key-Pins-Report-Only" 801#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \
802 "Public-Key-Pins-Report-Only"
780/* No category. RFC4437 */ 803/* No category. RFC4437 */
781#define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref" 804#define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
782/* Standard. RFC8555, Section 6.5.1 */ 805/* Standard. RFC8555, Section 6.5.1 */
@@ -843,7 +866,8 @@ MHD_get_reason_phrase_for (unsigned int code);
843#define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options" 866#define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
844 867
845/* Some provisional headers. */ 868/* Some provisional headers. */
846#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin" 869#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \
870 "Access-Control-Allow-Origin"
847/** @} */ /* end of group headers */ 871/** @} */ /* end of group headers */
848 872
849/** 873/**
@@ -954,7 +978,8 @@ MHD_get_reason_phrase_for (unsigned int code);
954 * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4 978 * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
955 * @{ 979 * @{
956 */ 980 */
957#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded" 981#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \
982 "application/x-www-form-urlencoded"
958#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data" 983#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
959 984
960/** @} */ /* end of group postenc */ 985/** @} */ /* end of group postenc */
@@ -1031,7 +1056,7 @@ enum MHD_FLAG
1031#if 0 1056#if 0
1032 /* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */ 1057 /* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */
1033#define MHD_USE_SSL \ 1058#define MHD_USE_SSL \
1034 _MHD_DEPR_IN_MACRO("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \ 1059 _MHD_DEPR_IN_MACRO ("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
1035 MHD_USE_TLS 1060 MHD_USE_TLS
1036#endif 1061#endif
1037 1062
@@ -1056,7 +1081,8 @@ enum MHD_FLAG
1056 MHD_USE_SELECT_INTERNALLY = 8, 1081 MHD_USE_SELECT_INTERNALLY = 8,
1057#if 0 /* Will be marked for real deprecation later. */ 1082#if 0 /* Will be marked for real deprecation later. */
1058#define MHD_USE_SELECT_INTERNALLY \ 1083#define MHD_USE_SELECT_INTERNALLY \
1059 _MHD_DEPR_IN_MACRO("Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \ 1084 _MHD_DEPR_IN_MACRO ( \
1085 "Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \
1060 MHD_USE_INTERNAL_POLLING_THREAD 1086 MHD_USE_INTERNAL_POLLING_THREAD
1061#endif /* 0 */ 1087#endif /* 0 */
1062 1088
@@ -1081,7 +1107,8 @@ enum MHD_FLAG
1081 MHD_USE_PEDANTIC_CHECKS = 32, 1107 MHD_USE_PEDANTIC_CHECKS = 32,
1082#if 0 /* Will be marked for real deprecation later. */ 1108#if 0 /* Will be marked for real deprecation later. */
1083#define MHD_USE_PEDANTIC_CHECKS \ 1109#define MHD_USE_PEDANTIC_CHECKS \
1084 _MHD_DEPR_IN_MACRO("Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \ 1110 _MHD_DEPR_IN_MACRO ( \
1111 "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \
1085 32 1112 32
1086#endif /* 0 */ 1113#endif /* 0 */
1087 1114
@@ -1105,7 +1132,8 @@ enum MHD_FLAG
1105 MHD_USE_POLL_INTERNALLY = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD, 1132 MHD_USE_POLL_INTERNALLY = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD,
1106#if 0 /* Will be marked for real deprecation later. */ 1133#if 0 /* Will be marked for real deprecation later. */
1107#define MHD_USE_POLL_INTERNALLY \ 1134#define MHD_USE_POLL_INTERNALLY \
1108 _MHD_DEPR_IN_MACRO("Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \ 1135 _MHD_DEPR_IN_MACRO ( \
1136 "Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \
1109 MHD_USE_POLL_INTERNAL_THREAD 1137 MHD_USE_POLL_INTERNAL_THREAD
1110#endif /* 0 */ 1138#endif /* 0 */
1111 1139
@@ -1121,7 +1149,8 @@ enum MHD_FLAG
1121 MHD_SUPPRESS_DATE_NO_CLOCK = 128, 1149 MHD_SUPPRESS_DATE_NO_CLOCK = 128,
1122#if 0 /* Will be marked for real deprecation later. */ 1150#if 0 /* Will be marked for real deprecation later. */
1123#define MHD_SUPPRESS_DATE_NO_CLOCK \ 1151#define MHD_SUPPRESS_DATE_NO_CLOCK \
1124 _MHD_DEPR_IN_MACRO("Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \ 1152 _MHD_DEPR_IN_MACRO ( \
1153 "Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
1125 MHD_USE_SUPPRESS_DATE_NO_CLOCK 1154 MHD_USE_SUPPRESS_DATE_NO_CLOCK
1126#endif /* 0 */ 1155#endif /* 0 */
1127 1156
@@ -1147,7 +1176,8 @@ enum MHD_FLAG
1147 MHD_USE_EPOLL_LINUX_ONLY = 512, 1176 MHD_USE_EPOLL_LINUX_ONLY = 512,
1148#if 0 /* Will be marked for real deprecation later. */ 1177#if 0 /* Will be marked for real deprecation later. */
1149#define MHD_USE_EPOLL_LINUX_ONLY \ 1178#define MHD_USE_EPOLL_LINUX_ONLY \
1150 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \ 1179 _MHD_DEPR_IN_MACRO ( \
1180 "Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
1151 MHD_USE_EPOLL 1181 MHD_USE_EPOLL
1152#endif /* 0 */ 1182#endif /* 0 */
1153 1183
@@ -1157,19 +1187,23 @@ enum MHD_FLAG
1157 * platform without `epoll` support will cause #MHD_start_daemon to fail. 1187 * platform without `epoll` support will cause #MHD_start_daemon to fail.
1158 * @sa ::MHD_FEATURE_EPOLL, #MHD_USE_EPOLL, #MHD_USE_INTERNAL_POLLING_THREAD 1188 * @sa ::MHD_FEATURE_EPOLL, #MHD_USE_EPOLL, #MHD_USE_INTERNAL_POLLING_THREAD
1159 */ 1189 */
1160 MHD_USE_EPOLL_INTERNAL_THREAD = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD, 1190 MHD_USE_EPOLL_INTERNAL_THREAD = MHD_USE_EPOLL
1191 | MHD_USE_INTERNAL_POLLING_THREAD,
1161 1192
1162 /** @deprecated */ 1193 /** @deprecated */
1163 MHD_USE_EPOLL_INTERNALLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD, 1194 MHD_USE_EPOLL_INTERNALLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD,
1164 /** @deprecated */ 1195 /** @deprecated */
1165 MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD, 1196 MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_EPOLL
1197 | MHD_USE_INTERNAL_POLLING_THREAD,
1166#if 0 /* Will be marked for real deprecation later. */ 1198#if 0 /* Will be marked for real deprecation later. */
1167#define MHD_USE_EPOLL_INTERNALLY \ 1199#define MHD_USE_EPOLL_INTERNALLY \
1168 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \ 1200 _MHD_DEPR_IN_MACRO ( \
1201 "Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1169 MHD_USE_EPOLL_INTERNAL_THREAD 1202 MHD_USE_EPOLL_INTERNAL_THREAD
1170 /** @deprecated */ 1203 /** @deprecated */
1171#define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \ 1204#define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \
1172 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \ 1205 _MHD_DEPR_IN_MACRO ( \
1206 "Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1173 MHD_USE_EPOLL_INTERNAL_THREAD 1207 MHD_USE_EPOLL_INTERNAL_THREAD
1174#endif /* 0 */ 1208#endif /* 0 */
1175 1209
@@ -1191,7 +1225,8 @@ enum MHD_FLAG
1191 MHD_USE_PIPE_FOR_SHUTDOWN = 1024, 1225 MHD_USE_PIPE_FOR_SHUTDOWN = 1024,
1192#if 0 /* Will be marked for real deprecation later. */ 1226#if 0 /* Will be marked for real deprecation later. */
1193#define MHD_USE_PIPE_FOR_SHUTDOWN \ 1227#define MHD_USE_PIPE_FOR_SHUTDOWN \
1194 _MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \ 1228 _MHD_DEPR_IN_MACRO ( \
1229 "Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
1195 MHD_USE_ITC 1230 MHD_USE_ITC
1196#endif /* 0 */ 1231#endif /* 0 */
1197 1232
@@ -1212,7 +1247,8 @@ enum MHD_FLAG
1212 MHD_USE_EPOLL_TURBO = 4096, 1247 MHD_USE_EPOLL_TURBO = 4096,
1213#if 0 /* Will be marked for real deprecation later. */ 1248#if 0 /* Will be marked for real deprecation later. */
1214#define MHD_USE_EPOLL_TURBO \ 1249#define MHD_USE_EPOLL_TURBO \
1215 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \ 1250 _MHD_DEPR_IN_MACRO ( \
1251 "Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
1216 MHD_USE_TURBO 1252 MHD_USE_TURBO
1217#endif /* 0 */ 1253#endif /* 0 */
1218 1254
@@ -1226,7 +1262,8 @@ enum MHD_FLAG
1226 MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_ITC, 1262 MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_ITC,
1227#if 0 /* Will be marked for real deprecation later. */ 1263#if 0 /* Will be marked for real deprecation later. */
1228#define MHD_USE_SUSPEND_RESUME \ 1264#define MHD_USE_SUSPEND_RESUME \
1229 _MHD_DEPR_IN_MACRO("Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \ 1265 _MHD_DEPR_IN_MACRO ( \
1266 "Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \
1230 MHD_ALLOW_SUSPEND_RESUME 1267 MHD_ALLOW_SUSPEND_RESUME
1231#endif /* 0 */ 1268#endif /* 0 */
1232 1269
@@ -1269,13 +1306,13 @@ enum MHD_FLAG
1269 * Flag set to enable post-handshake client authentication 1306 * Flag set to enable post-handshake client authentication
1270 * (only useful in combination with #MHD_USE_TLS). 1307 * (only useful in combination with #MHD_USE_TLS).
1271 */ 1308 */
1272 MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT = 1U <<17, 1309 MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT = 1U << 17,
1273 1310
1274 /** 1311 /**
1275 * Flag set to enable TLS 1.3 early data. This has 1312 * Flag set to enable TLS 1.3 early data. This has
1276 * security implications, be VERY careful when using this. 1313 * security implications, be VERY careful when using this.
1277 */ 1314 */
1278 MHD_USE_INSECURE_TLS_EARLY_DATA = 1U <<18 1315 MHD_USE_INSECURE_TLS_EARLY_DATA = 1U << 18
1279 1316
1280}; 1317};
1281 1318
@@ -1308,10 +1345,10 @@ typedef void
1308 */ 1345 */
1309typedef int 1346typedef int
1310(*MHD_PskServerCredentialsCallback)(void *cls, 1347(*MHD_PskServerCredentialsCallback)(void *cls,
1311 const struct MHD_Connection *connection, 1348 const struct MHD_Connection *connection,
1312 const char *username, 1349 const char *username,
1313 void **psk, 1350 void **psk,
1314 size_t *psk_size); 1351 size_t *psk_size);
1315 1352
1316/** 1353/**
1317 * @brief MHD options. 1354 * @brief MHD options.
@@ -1654,7 +1691,7 @@ enum MHD_OPTION
1654 * followed by a argument of type `gnutls_certificate_retrieve_function3 *`. 1691 * followed by a argument of type `gnutls_certificate_retrieve_function3 *`.
1655 * This option provides an 1692 * This option provides an
1656 * alternative/extension to #MHD_OPTION_HTTPS_CERT_CALLBACK. 1693 * alternative/extension to #MHD_OPTION_HTTPS_CERT_CALLBACK.
1657 * You must use this version if you want to use OCSP stapling. 1694 * You must use this version if you want to use OCSP stapling.
1658 * Using this option requires GnuTLS 3.6.3 or higher. 1695 * Using this option requires GnuTLS 3.6.3 or higher.
1659 */ 1696 */
1660 MHD_OPTION_HTTPS_CERT_CALLBACK2 = 31 1697 MHD_OPTION_HTTPS_CERT_CALLBACK2 = 31
@@ -1701,7 +1738,8 @@ enum MHD_ValueKind
1701 */ 1738 */
1702 MHD_RESPONSE_HEADER_KIND = 0, 1739 MHD_RESPONSE_HEADER_KIND = 0,
1703#define MHD_RESPONSE_HEADER_KIND \ 1740#define MHD_RESPONSE_HEADER_KIND \
1704 _MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \ 1741 _MHD_DEPR_IN_MACRO ( \
1742 "Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
1705 MHD_RESPONSE_HEADER_KIND 1743 MHD_RESPONSE_HEADER_KIND
1706 1744
1707 /** 1745 /**
@@ -2197,11 +2235,11 @@ typedef int
2197 */ 2235 */
2198typedef int 2236typedef int
2199(*MHD_KeyValueIteratorN) (void *cls, 2237(*MHD_KeyValueIteratorN) (void *cls,
2200 enum MHD_ValueKind kind, 2238 enum MHD_ValueKind kind,
2201 const char *key, 2239 const char *key,
2202 size_t key_size, 2240 size_t key_size,
2203 const char *value, 2241 const char *value,
2204 size_t value_size); 2242 size_t value_size);
2205 2243
2206 2244
2207/** 2245/**
@@ -2323,10 +2361,10 @@ typedef int
2323 */ 2361 */
2324_MHD_EXTERN struct MHD_Daemon * 2362_MHD_EXTERN struct MHD_Daemon *
2325MHD_start_daemon_va (unsigned int flags, 2363MHD_start_daemon_va (unsigned int flags,
2326 uint16_t port, 2364 uint16_t port,
2327 MHD_AcceptPolicyCallback apc, void *apc_cls, 2365 MHD_AcceptPolicyCallback apc, void *apc_cls,
2328 MHD_AccessHandlerCallback dh, void *dh_cls, 2366 MHD_AccessHandlerCallback dh, void *dh_cls,
2329 va_list ap); 2367 va_list ap);
2330 2368
2331 2369
2332/** 2370/**
@@ -2351,10 +2389,10 @@ MHD_start_daemon_va (unsigned int flags,
2351 */ 2389 */
2352_MHD_EXTERN struct MHD_Daemon * 2390_MHD_EXTERN struct MHD_Daemon *
2353MHD_start_daemon (unsigned int flags, 2391MHD_start_daemon (unsigned int flags,
2354 uint16_t port, 2392 uint16_t port,
2355 MHD_AcceptPolicyCallback apc, void *apc_cls, 2393 MHD_AcceptPolicyCallback apc, void *apc_cls,
2356 MHD_AccessHandlerCallback dh, void *dh_cls, 2394 MHD_AccessHandlerCallback dh, void *dh_cls,
2357 ...); 2395 ...);
2358 2396
2359 2397
2360/** 2398/**
@@ -2419,9 +2457,9 @@ MHD_stop_daemon (struct MHD_Daemon *daemon);
2419 */ 2457 */
2420_MHD_EXTERN int 2458_MHD_EXTERN int
2421MHD_add_connection (struct MHD_Daemon *daemon, 2459MHD_add_connection (struct MHD_Daemon *daemon,
2422 MHD_socket client_socket, 2460 MHD_socket client_socket,
2423 const struct sockaddr *addr, 2461 const struct sockaddr *addr,
2424 socklen_t addrlen); 2462 socklen_t addrlen);
2425 2463
2426 2464
2427/** 2465/**
@@ -2457,8 +2495,8 @@ _MHD_EXTERN int
2457MHD_get_fdset (struct MHD_Daemon *daemon, 2495MHD_get_fdset (struct MHD_Daemon *daemon,
2458 fd_set *read_fd_set, 2496 fd_set *read_fd_set,
2459 fd_set *write_fd_set, 2497 fd_set *write_fd_set,
2460 fd_set *except_fd_set, 2498 fd_set *except_fd_set,
2461 MHD_socket *max_fd); 2499 MHD_socket *max_fd);
2462 2500
2463 2501
2464/** 2502/**
@@ -2495,11 +2533,11 @@ MHD_get_fdset (struct MHD_Daemon *daemon,
2495 */ 2533 */
2496_MHD_EXTERN int 2534_MHD_EXTERN int
2497MHD_get_fdset2 (struct MHD_Daemon *daemon, 2535MHD_get_fdset2 (struct MHD_Daemon *daemon,
2498 fd_set *read_fd_set, 2536 fd_set *read_fd_set,
2499 fd_set *write_fd_set, 2537 fd_set *write_fd_set,
2500 fd_set *except_fd_set, 2538 fd_set *except_fd_set,
2501 MHD_socket *max_fd, 2539 MHD_socket *max_fd,
2502 unsigned int fd_setsize); 2540 unsigned int fd_setsize);
2503 2541
2504 2542
2505/** 2543/**
@@ -2527,7 +2565,8 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon,
2527 * @ingroup event 2565 * @ingroup event
2528 */ 2566 */
2529#define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \ 2567#define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
2530 MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE) 2568 MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \
2569 (max_fd),FD_SETSIZE)
2531 2570
2532 2571
2533/** 2572/**
@@ -2550,7 +2589,7 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon,
2550 */ 2589 */
2551_MHD_EXTERN int 2590_MHD_EXTERN int
2552MHD_get_timeout (struct MHD_Daemon *daemon, 2591MHD_get_timeout (struct MHD_Daemon *daemon,
2553 MHD_UNSIGNED_LONG_LONG *timeout); 2592 MHD_UNSIGNED_LONG_LONG *timeout);
2554 2593
2555 2594
2556/** 2595/**
@@ -2601,9 +2640,9 @@ MHD_run (struct MHD_Daemon *daemon);
2601 */ 2640 */
2602_MHD_EXTERN int 2641_MHD_EXTERN int
2603MHD_run_from_select (struct MHD_Daemon *daemon, 2642MHD_run_from_select (struct MHD_Daemon *daemon,
2604 const fd_set *read_fd_set, 2643 const fd_set *read_fd_set,
2605 const fd_set *write_fd_set, 2644 const fd_set *write_fd_set,
2606 const fd_set *except_fd_set); 2645 const fd_set *except_fd_set);
2607 2646
2608 2647
2609 2648
@@ -2678,7 +2717,7 @@ _MHD_EXTERN int
2678MHD_set_connection_value (struct MHD_Connection *connection, 2717MHD_set_connection_value (struct MHD_Connection *connection,
2679 enum MHD_ValueKind kind, 2718 enum MHD_ValueKind kind,
2680 const char *key, 2719 const char *key,
2681 const char *value); 2720 const char *value);
2682 2721
2683 2722
2684/** 2723/**
@@ -2708,11 +2747,11 @@ MHD_set_connection_value (struct MHD_Connection *connection,
2708 */ 2747 */
2709int 2748int
2710MHD_set_connection_value_n (struct MHD_Connection *connection, 2749MHD_set_connection_value_n (struct MHD_Connection *connection,
2711 enum MHD_ValueKind kind, 2750 enum MHD_ValueKind kind,
2712 const char *key, 2751 const char *key,
2713 size_t key_size, 2752 size_t key_size,
2714 const char *value, 2753 const char *value,
2715 size_t value_size); 2754 size_t value_size);
2716 2755
2717 2756
2718/** 2757/**
@@ -2760,8 +2799,8 @@ MHD_http_unescape (char *val);
2760 */ 2799 */
2761_MHD_EXTERN const char * 2800_MHD_EXTERN const char *
2762MHD_lookup_connection_value (struct MHD_Connection *connection, 2801MHD_lookup_connection_value (struct MHD_Connection *connection,
2763 enum MHD_ValueKind kind, 2802 enum MHD_ValueKind kind,
2764 const char *key); 2803 const char *key);
2765 2804
2766 2805
2767/** 2806/**
@@ -2806,7 +2845,7 @@ MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2806_MHD_EXTERN int 2845_MHD_EXTERN int
2807MHD_queue_response (struct MHD_Connection *connection, 2846MHD_queue_response (struct MHD_Connection *connection,
2808 unsigned int status_code, 2847 unsigned int status_code,
2809 struct MHD_Response *response); 2848 struct MHD_Response *response);
2810 2849
2811 2850
2812/** 2851/**
@@ -2934,9 +2973,9 @@ MHD_set_response_options (struct MHD_Response *response,
2934 */ 2973 */
2935_MHD_EXTERN struct MHD_Response * 2974_MHD_EXTERN struct MHD_Response *
2936MHD_create_response_from_callback (uint64_t size, 2975MHD_create_response_from_callback (uint64_t size,
2937 size_t block_size, 2976 size_t block_size,
2938 MHD_ContentReaderCallback crc, void *crc_cls, 2977 MHD_ContentReaderCallback crc, void *crc_cls,
2939 MHD_ContentReaderFreeCallback crfc); 2978 MHD_ContentReaderFreeCallback crfc);
2940 2979
2941 2980
2942/** 2981/**
@@ -2953,12 +2992,13 @@ MHD_create_response_from_callback (uint64_t size,
2953 * @deprecated use #MHD_create_response_from_buffer instead 2992 * @deprecated use #MHD_create_response_from_buffer instead
2954 * @ingroup response 2993 * @ingroup response
2955 */ 2994 */
2956_MHD_DEPR_FUNC("MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \ 2995_MHD_DEPR_FUNC (
2957_MHD_EXTERN struct MHD_Response * 2996 "MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
2997 _MHD_EXTERN struct MHD_Response *
2958MHD_create_response_from_data (size_t size, 2998MHD_create_response_from_data (size_t size,
2959 void *data, 2999 void *data,
2960 int must_free, 3000 int must_free,
2961 int must_copy); 3001 int must_copy);
2962 3002
2963 3003
2964/** 3004/**
@@ -3009,8 +3049,8 @@ enum MHD_ResponseMemoryMode
3009 */ 3049 */
3010_MHD_EXTERN struct MHD_Response * 3050_MHD_EXTERN struct MHD_Response *
3011MHD_create_response_from_buffer (size_t size, 3051MHD_create_response_from_buffer (size_t size,
3012 void *buffer, 3052 void *buffer,
3013 enum MHD_ResponseMemoryMode mode); 3053 enum MHD_ResponseMemoryMode mode);
3014 3054
3015 3055
3016 3056
@@ -3027,8 +3067,9 @@ MHD_create_response_from_buffer (size_t size,
3027 */ 3067 */
3028_MHD_EXTERN struct MHD_Response * 3068_MHD_EXTERN struct MHD_Response *
3029MHD_create_response_from_buffer_with_free_callback (size_t size, 3069MHD_create_response_from_buffer_with_free_callback (size_t size,
3030 void *buffer, 3070 void *buffer,
3031 MHD_ContentReaderFreeCallback crfc); 3071 MHD_ContentReaderFreeCallback
3072 crfc);
3032 3073
3033 3074
3034/** 3075/**
@@ -3044,7 +3085,7 @@ MHD_create_response_from_buffer_with_free_callback (size_t size,
3044 */ 3085 */
3045_MHD_EXTERN struct MHD_Response * 3086_MHD_EXTERN struct MHD_Response *
3046MHD_create_response_from_fd (size_t size, 3087MHD_create_response_from_fd (size_t size,
3047 int fd); 3088 int fd);
3048 3089
3049 3090
3050/** 3091/**
@@ -3081,18 +3122,20 @@ MHD_create_response_from_fd64 (uint64_t size,
3081 * @return NULL on error (i.e. invalid arguments, out of memory) 3122 * @return NULL on error (i.e. invalid arguments, out of memory)
3082 * @ingroup response 3123 * @ingroup response
3083 */ 3124 */
3084_MHD_DEPR_FUNC("Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \ 3125_MHD_DEPR_FUNC (
3085_MHD_EXTERN struct MHD_Response * 3126 "Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3127 _MHD_EXTERN struct MHD_Response *
3086MHD_create_response_from_fd_at_offset (size_t size, 3128MHD_create_response_from_fd_at_offset (size_t size,
3087 int fd, 3129 int fd,
3088 off_t offset); 3130 off_t offset);
3089 3131
3090#if !defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC) 3132#if ! defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
3091/* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset() 3133/* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset()
3092 to minimize potential problems with different off_t sizes */ 3134 to minimize potential problems with different off_t sizes */
3093#define MHD_create_response_from_fd_at_offset(size,fd,offset) \ 3135#define MHD_create_response_from_fd_at_offset(size,fd,offset) \
3094 _MHD_DEPR_IN_MACRO("Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \ 3136 _MHD_DEPR_IN_MACRO ( \
3095 MHD_create_response_from_fd_at_offset64((size),(fd),(offset)) 3137 "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3138 MHD_create_response_from_fd_at_offset64 ((size),(fd),(offset))
3096#endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */ 3139#endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
3097 3140
3098 3141
@@ -3261,7 +3304,7 @@ typedef void
3261 */ 3304 */
3262_MHD_EXTERN struct MHD_Response * 3305_MHD_EXTERN struct MHD_Response *
3263MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, 3306MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
3264 void *upgrade_handler_cls); 3307 void *upgrade_handler_cls);
3265 3308
3266 3309
3267/** 3310/**
@@ -3290,7 +3333,7 @@ MHD_destroy_response (struct MHD_Response *response);
3290_MHD_EXTERN int 3333_MHD_EXTERN int
3291MHD_add_response_header (struct MHD_Response *response, 3334MHD_add_response_header (struct MHD_Response *response,
3292 const char *header, 3335 const char *header,
3293 const char *content); 3336 const char *content);
3294 3337
3295 3338
3296/** 3339/**
@@ -3305,7 +3348,7 @@ MHD_add_response_header (struct MHD_Response *response,
3305_MHD_EXTERN int 3348_MHD_EXTERN int
3306MHD_add_response_footer (struct MHD_Response *response, 3349MHD_add_response_footer (struct MHD_Response *response,
3307 const char *footer, 3350 const char *footer,
3308 const char *content); 3351 const char *content);
3309 3352
3310 3353
3311/** 3354/**
@@ -3320,7 +3363,7 @@ MHD_add_response_footer (struct MHD_Response *response,
3320_MHD_EXTERN int 3363_MHD_EXTERN int
3321MHD_del_response_header (struct MHD_Response *response, 3364MHD_del_response_header (struct MHD_Response *response,
3322 const char *header, 3365 const char *header,
3323 const char *content); 3366 const char *content);
3324 3367
3325 3368
3326/** 3369/**
@@ -3336,7 +3379,7 @@ MHD_del_response_header (struct MHD_Response *response,
3336_MHD_EXTERN int 3379_MHD_EXTERN int
3337MHD_get_response_headers (struct MHD_Response *response, 3380MHD_get_response_headers (struct MHD_Response *response,
3338 MHD_KeyValueIterator iterator, 3381 MHD_KeyValueIterator iterator,
3339 void *iterator_cls); 3382 void *iterator_cls);
3340 3383
3341 3384
3342/** 3385/**
@@ -3349,7 +3392,7 @@ MHD_get_response_headers (struct MHD_Response *response,
3349 */ 3392 */
3350_MHD_EXTERN const char * 3393_MHD_EXTERN const char *
3351MHD_get_response_header (struct MHD_Response *response, 3394MHD_get_response_header (struct MHD_Response *response,
3352 const char *key); 3395 const char *key);
3353 3396
3354 3397
3355/* ********************** PostProcessor functions ********************** */ 3398/* ********************** PostProcessor functions ********************** */
@@ -3381,8 +3424,8 @@ MHD_get_response_header (struct MHD_Response *response,
3381 */ 3424 */
3382_MHD_EXTERN struct MHD_PostProcessor * 3425_MHD_EXTERN struct MHD_PostProcessor *
3383MHD_create_post_processor (struct MHD_Connection *connection, 3426MHD_create_post_processor (struct MHD_Connection *connection,
3384 size_t buffer_size, 3427 size_t buffer_size,
3385 MHD_PostDataIterator iter, void *iter_cls); 3428 MHD_PostDataIterator iter, void *iter_cls);
3386 3429
3387 3430
3388/** 3431/**
@@ -3433,7 +3476,7 @@ MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
3433 * 3476 *
3434 * @param connection The MHD connection structure 3477 * @param connection The MHD connection structure
3435 * @return NULL if no username could be found, a pointer 3478 * @return NULL if no username could be found, a pointer
3436 * to the username if found, free using #MHD_free(). 3479 * to the username if found, free using #MHD_free().
3437 * @ingroup authentication 3480 * @ingroup authentication
3438 */ 3481 */
3439_MHD_EXTERN char * 3482_MHD_EXTERN char *
@@ -3455,7 +3498,8 @@ MHD_free (void *ptr);
3455/** 3498/**
3456 * Which digest algorithm should MHD use for HTTP digest authentication? 3499 * Which digest algorithm should MHD use for HTTP digest authentication?
3457 */ 3500 */
3458enum MHD_DigestAuthAlgorithm { 3501enum MHD_DigestAuthAlgorithm
3502{
3459 3503
3460 /** 3504 /**
3461 * MHD should pick (currently defaults to SHA-256). 3505 * MHD should pick (currently defaults to SHA-256).
@@ -3483,19 +3527,19 @@ enum MHD_DigestAuthAlgorithm {
3483 * @param username The username needs to be authenticated 3527 * @param username The username needs to be authenticated
3484 * @param password The password used in the authentication 3528 * @param password The password used in the authentication
3485 * @param nonce_timeout The amount of time for a nonce to be 3529 * @param nonce_timeout The amount of time for a nonce to be
3486 * invalid in seconds 3530 * invalid in seconds
3487 * @param algo digest algorithms allowed for verification 3531 * @param algo digest algorithms allowed for verification
3488 * @return #MHD_YES if authenticated, #MHD_NO if not, 3532 * @return #MHD_YES if authenticated, #MHD_NO if not,
3489 * #MHD_INVALID_NONCE if nonce is invalid 3533 * #MHD_INVALID_NONCE if nonce is invalid
3490 * @ingroup authentication 3534 * @ingroup authentication
3491 */ 3535 */
3492_MHD_EXTERN int 3536_MHD_EXTERN int
3493MHD_digest_auth_check2 (struct MHD_Connection *connection, 3537MHD_digest_auth_check2 (struct MHD_Connection *connection,
3494 const char *realm, 3538 const char *realm,
3495 const char *username, 3539 const char *username,
3496 const char *password, 3540 const char *password,
3497 unsigned int nonce_timeout, 3541 unsigned int nonce_timeout,
3498 enum MHD_DigestAuthAlgorithm algo); 3542 enum MHD_DigestAuthAlgorithm algo);
3499 3543
3500 3544
3501/** 3545/**
@@ -3510,18 +3554,18 @@ MHD_digest_auth_check2 (struct MHD_Connection *connection,
3510 * @param username The username needs to be authenticated 3554 * @param username The username needs to be authenticated
3511 * @param password The password used in the authentication 3555 * @param password The password used in the authentication
3512 * @param nonce_timeout The amount of time for a nonce to be 3556 * @param nonce_timeout The amount of time for a nonce to be
3513 * invalid in seconds 3557 * invalid in seconds
3514 * @return #MHD_YES if authenticated, #MHD_NO if not, 3558 * @return #MHD_YES if authenticated, #MHD_NO if not,
3515 * #MHD_INVALID_NONCE if nonce is invalid 3559 * #MHD_INVALID_NONCE if nonce is invalid
3516 * @ingroup authentication 3560 * @ingroup authentication
3517 * @deprecated use MHD_digest_auth_check2() 3561 * @deprecated use MHD_digest_auth_check2()
3518 */ 3562 */
3519_MHD_EXTERN int 3563_MHD_EXTERN int
3520MHD_digest_auth_check (struct MHD_Connection *connection, 3564MHD_digest_auth_check (struct MHD_Connection *connection,
3521 const char *realm, 3565 const char *realm,
3522 const char *username, 3566 const char *username,
3523 const char *password, 3567 const char *password,
3524 unsigned int nonce_timeout); 3568 unsigned int nonce_timeout);
3525 3569
3526 3570
3527/** 3571/**
@@ -3531,24 +3575,24 @@ MHD_digest_auth_check (struct MHD_Connection *connection,
3531 * @param realm The realm presented to the client 3575 * @param realm The realm presented to the client
3532 * @param username The username needs to be authenticated 3576 * @param username The username needs to be authenticated
3533 * @param digest An `unsigned char *' pointer to the binary MD5 sum 3577 * @param digest An `unsigned char *' pointer to the binary MD5 sum
3534 * for the precalculated hash value "username:realm:password" 3578 * for the precalculated hash value "username:realm:password"
3535 * of @a digest_size bytes 3579 * of @a digest_size bytes
3536 * @param digest_size number of bytes in @a digest (size must match @a algo!) 3580 * @param digest_size number of bytes in @a digest (size must match @a algo!)
3537 * @param nonce_timeout The amount of time for a nonce to be 3581 * @param nonce_timeout The amount of time for a nonce to be
3538 * invalid in seconds 3582 * invalid in seconds
3539 * @param algo digest algorithms allowed for verification 3583 * @param algo digest algorithms allowed for verification
3540 * @return #MHD_YES if authenticated, #MHD_NO if not, 3584 * @return #MHD_YES if authenticated, #MHD_NO if not,
3541 * #MHD_INVALID_NONCE if nonce is invalid 3585 * #MHD_INVALID_NONCE if nonce is invalid
3542 * @ingroup authentication 3586 * @ingroup authentication
3543 */ 3587 */
3544_MHD_EXTERN int 3588_MHD_EXTERN int
3545MHD_digest_auth_check_digest2 (struct MHD_Connection *connection, 3589MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3546 const char *realm, 3590 const char *realm,
3547 const char *username, 3591 const char *username,
3548 const uint8_t *digest, 3592 const uint8_t *digest,
3549 size_t digest_size, 3593 size_t digest_size,
3550 unsigned int nonce_timeout, 3594 unsigned int nonce_timeout,
3551 enum MHD_DigestAuthAlgorithm algo); 3595 enum MHD_DigestAuthAlgorithm algo);
3552 3596
3553 3597
3554/** 3598/**
@@ -3560,21 +3604,21 @@ MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3560 * @param realm The realm presented to the client 3604 * @param realm The realm presented to the client
3561 * @param username The username needs to be authenticated 3605 * @param username The username needs to be authenticated
3562 * @param digest An `unsigned char *' pointer to the binary hash 3606 * @param digest An `unsigned char *' pointer to the binary hash
3563 * for the precalculated hash value "username:realm:password"; 3607 * for the precalculated hash value "username:realm:password";
3564 * length must be #MHD_MD5_DIGEST_SIZE bytes 3608 * length must be #MHD_MD5_DIGEST_SIZE bytes
3565 * @param nonce_timeout The amount of time for a nonce to be 3609 * @param nonce_timeout The amount of time for a nonce to be
3566 * invalid in seconds 3610 * invalid in seconds
3567 * @return #MHD_YES if authenticated, #MHD_NO if not, 3611 * @return #MHD_YES if authenticated, #MHD_NO if not,
3568 * #MHD_INVALID_NONCE if nonce is invalid 3612 * #MHD_INVALID_NONCE if nonce is invalid
3569 * @ingroup authentication 3613 * @ingroup authentication
3570 * @deprecated use #MHD_digest_auth_check_digest2() 3614 * @deprecated use #MHD_digest_auth_check_digest2()
3571 */ 3615 */
3572_MHD_EXTERN int 3616_MHD_EXTERN int
3573MHD_digest_auth_check_digest (struct MHD_Connection *connection, 3617MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3574 const char *realm, 3618 const char *realm,
3575 const char *username, 3619 const char *username,
3576 const uint8_t digest[MHD_MD5_DIGEST_SIZE], 3620 const uint8_t digest[MHD_MD5_DIGEST_SIZE],
3577 unsigned int nonce_timeout); 3621 unsigned int nonce_timeout);
3578 3622
3579 3623
3580/** 3624/**
@@ -3587,18 +3631,18 @@ MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3587 * body; note that this function will set the "WWW Authenticate" 3631 * body; note that this function will set the "WWW Authenticate"
3588 * header and that the caller should not do this 3632 * header and that the caller should not do this
3589 * @param signal_stale #MHD_YES if the nonce is invalid to add 3633 * @param signal_stale #MHD_YES if the nonce is invalid to add
3590 * 'stale=true' to the authentication header 3634 * 'stale=true' to the authentication header
3591 * @param algo digest algorithm to use 3635 * @param algo digest algorithm to use
3592 * @return #MHD_YES on success, #MHD_NO otherwise 3636 * @return #MHD_YES on success, #MHD_NO otherwise
3593 * @ingroup authentication 3637 * @ingroup authentication
3594 */ 3638 */
3595_MHD_EXTERN int 3639_MHD_EXTERN int
3596MHD_queue_auth_fail_response2 (struct MHD_Connection *connection, 3640MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3597 const char *realm, 3641 const char *realm,
3598 const char *opaque, 3642 const char *opaque,
3599 struct MHD_Response *response, 3643 struct MHD_Response *response,
3600 int signal_stale, 3644 int signal_stale,
3601 enum MHD_DigestAuthAlgorithm algo); 3645 enum MHD_DigestAuthAlgorithm algo);
3602 3646
3603 3647
3604/** 3648/**
@@ -3613,17 +3657,17 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3613 * body; note that this function will set the "WWW Authenticate" 3657 * body; note that this function will set the "WWW Authenticate"
3614 * header and that the caller should not do this 3658 * header and that the caller should not do this
3615 * @param signal_stale #MHD_YES if the nonce is invalid to add 3659 * @param signal_stale #MHD_YES if the nonce is invalid to add
3616 * 'stale=true' to the authentication header 3660 * 'stale=true' to the authentication header
3617 * @return #MHD_YES on success, #MHD_NO otherwise 3661 * @return #MHD_YES on success, #MHD_NO otherwise
3618 * @ingroup authentication 3662 * @ingroup authentication
3619 * @deprecated use MHD_queue_auth_fail_response2() 3663 * @deprecated use MHD_queue_auth_fail_response2()
3620 */ 3664 */
3621_MHD_EXTERN int 3665_MHD_EXTERN int
3622MHD_queue_auth_fail_response (struct MHD_Connection *connection, 3666MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3623 const char *realm, 3667 const char *realm,
3624 const char *opaque, 3668 const char *opaque,
3625 struct MHD_Response *response, 3669 struct MHD_Response *response,
3626 int signal_stale); 3670 int signal_stale);
3627 3671
3628 3672
3629/** 3673/**
@@ -3632,12 +3676,12 @@ MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3632 * @param connection The MHD connection structure 3676 * @param connection The MHD connection structure
3633 * @param[out] password a pointer for the password, free using #MHD_free(). 3677 * @param[out] password a pointer for the password, free using #MHD_free().
3634 * @return NULL if no username could be found, a pointer 3678 * @return NULL if no username could be found, a pointer
3635 * to the username if found, free using #MHD_free(). 3679 * to the username if found, free using #MHD_free().
3636 * @ingroup authentication 3680 * @ingroup authentication
3637 */ 3681 */
3638_MHD_EXTERN char * 3682_MHD_EXTERN char *
3639MHD_basic_auth_get_username_password (struct MHD_Connection *connection, 3683MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
3640 char** password); 3684 char**password);
3641 3685
3642 3686
3643/** 3687/**
@@ -3654,8 +3698,8 @@ MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
3654 */ 3698 */
3655_MHD_EXTERN int 3699_MHD_EXTERN int
3656MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection, 3700MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection,
3657 const char *realm, 3701 const char *realm,
3658 struct MHD_Response *response); 3702 struct MHD_Response *response);
3659 3703
3660/* ********************** generic query functions ********************** */ 3704/* ********************** generic query functions ********************** */
3661 3705
@@ -3672,8 +3716,8 @@ MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection,
3672 */ 3716 */
3673_MHD_EXTERN const union MHD_ConnectionInfo * 3717_MHD_EXTERN const union MHD_ConnectionInfo *
3674MHD_get_connection_info (struct MHD_Connection *connection, 3718MHD_get_connection_info (struct MHD_Connection *connection,
3675 enum MHD_ConnectionInfoType info_type, 3719 enum MHD_ConnectionInfoType info_type,
3676 ...); 3720 ...);
3677 3721
3678 3722
3679/** 3723/**
@@ -3706,8 +3750,8 @@ enum MHD_CONNECTION_OPTION
3706 */ 3750 */
3707_MHD_EXTERN int 3751_MHD_EXTERN int
3708MHD_set_connection_option (struct MHD_Connection *connection, 3752MHD_set_connection_option (struct MHD_Connection *connection,
3709 enum MHD_CONNECTION_OPTION option, 3753 enum MHD_CONNECTION_OPTION option,
3710 ...); 3754 ...);
3711 3755
3712 3756
3713/** 3757/**
@@ -3770,8 +3814,8 @@ union MHD_DaemonInfo
3770 */ 3814 */
3771_MHD_EXTERN const union MHD_DaemonInfo * 3815_MHD_EXTERN const union MHD_DaemonInfo *
3772MHD_get_daemon_info (struct MHD_Daemon *daemon, 3816MHD_get_daemon_info (struct MHD_Daemon *daemon,
3773 enum MHD_DaemonInfoType info_type, 3817 enum MHD_DaemonInfoType info_type,
3774 ...); 3818 ...);
3775 3819
3776 3820
3777/** 3821/**