aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-17 16:56:41 +0200
committerChristian Grothoff <christian@grothoff.org>2019-10-17 16:56:41 +0200
commit972103dc288e2a2396e060018e7c3733f29a940d (patch)
treeaeb0b3a182d5168f12752928d3204342c9581e91 /src/include
parentcbbfd0591fc639ddd21a5850f54f403fb7394174 (diff)
downloadlibmicrohttpd-972103dc288e2a2396e060018e7c3733f29a940d.tar.gz
libmicrohttpd-972103dc288e2a2396e060018e7c3733f29a940d.zip
applying uncrustify to ensure uniform indentation
Diffstat (limited to 'src/include')
-rw-r--r--src/include/autoinit_funcs.h105
-rw-r--r--src/include/mhd_options.h14
-rw-r--r--src/include/microhttpd.h390
-rw-r--r--src/include/microhttpd2.h488
-rw-r--r--src/include/microhttpd_tls.h56
-rw-r--r--src/include/platform.h16
6 files changed, 573 insertions, 496 deletions
diff --git a/src/include/autoinit_funcs.h b/src/include/autoinit_funcs.h
index d925c7be..c4f3d014 100644
--- a/src/include/autoinit_funcs.h
+++ b/src/include/autoinit_funcs.h
@@ -20,7 +20,7 @@
20/* 20/*
21 General usage is simple: include this header, declare or define two 21 General usage is simple: include this header, declare or define two
22 functions with zero parameters (void) and any return type: one for 22 functions with zero parameters (void) and any return type: one for
23 initialization and one for deinitialization, add 23 initialization and one for deinitialization, add
24 _SET_INIT_AND_DEINIT_FUNCS(FuncInitName, FuncDeInitName) to the code 24 _SET_INIT_AND_DEINIT_FUNCS(FuncInitName, FuncDeInitName) to the code
25 and functions will be automatically called during application startup 25 and functions will be automatically called during application startup
26 and shutdown. 26 and shutdown.
@@ -70,9 +70,9 @@
70#define AUTOINIT_FUNCS_VERSION 0x01000100 70#define AUTOINIT_FUNCS_VERSION 0x01000100
71 71
72#if defined(__GNUC__) 72#if defined(__GNUC__)
73 /* if possible - check for supported attribute */ 73/* if possible - check for supported attribute */
74#ifdef __has_attribute 74#ifdef __has_attribute
75#if !__has_attribute(constructor) || !__has_attribute(destructor) 75#if ! __has_attribute (constructor) || ! __has_attribute (destructor)
76#define _GNUC_ATTR_CONSTR_NOT_SUPPORTED 1 76#define _GNUC_ATTR_CONSTR_NOT_SUPPORTED 1
77#endif /* !__has_attribute(constructor) || !__has_attribute(destructor) */ 77#endif /* !__has_attribute(constructor) || !__has_attribute(destructor) */
78#endif /* __has_attribute */ 78#endif /* __has_attribute */
@@ -80,20 +80,20 @@
80 80
81/* "_attribute__ ((constructor))" is supported by GCC, clang and 81/* "_attribute__ ((constructor))" is supported by GCC, clang and
82 Sun/Oracle compiler starting from version 12.1. */ 82 Sun/Oracle compiler starting from version 12.1. */
83#if (defined(__GNUC__) && !defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)) || \ 83#if (defined(__GNUC__) && ! defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)) || \
84 (defined(__SUNPRO_C) && __SUNPRO_C+0 >= 0x5100) 84 (defined(__SUNPRO_C) && __SUNPRO_C + 0 >= 0x5100)
85 85
86#define GNUC_SET_INIT_AND_DEINIT(FI,FD) \ 86#define GNUC_SET_INIT_AND_DEINIT(FI,FD) \
87 void __attribute__ ((constructor)) _GNUC_init_helper_##FI(void) \ 87 void __attribute__ ((constructor)) _GNUC_init_helper_ ## FI (void) \
88 { (void)(FI)(); } \ 88 { (void) (FI) (); } \
89 void __attribute__ ((destructor)) _GNUC_deinit_helper_##FD(void) \ 89 void __attribute__ ((destructor)) _GNUC_deinit_helper_ ## FD (void) \
90 { (void)(FD)(); } \ 90 { (void) (FD) (); } \
91 struct _GNUC_dummy_str_##FI{int i;} 91 struct _GNUC_dummy_str_ ## FI {int i;}
92 92
93#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) GNUC_SET_INIT_AND_DEINIT(FI,FD) 93#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) GNUC_SET_INIT_AND_DEINIT (FI,FD)
94#define _AUTOINIT_FUNCS_ARE_SUPPORTED 1 94#define _AUTOINIT_FUNCS_ARE_SUPPORTED 1
95 95
96#elif defined (_MSC_FULL_VER) && _MSC_VER+0 >= 1600 96#elif defined (_MSC_FULL_VER) && _MSC_VER + 0 >= 1600
97 97
98/* Make sure that your project/sources define: 98/* Make sure that your project/sources define:
99 _LIB if building a static library (_LIB is ignored if _CONSOLE is defined); 99 _LIB if building a static library (_LIB is ignored if _CONSOLE is defined);
@@ -107,9 +107,9 @@
107 107
108/* Stringify macros */ 108/* Stringify macros */
109#define _INSTRMACRO(a) #a 109#define _INSTRMACRO(a) #a
110#define _STRMACRO(a) _INSTRMACRO(a) 110#define _STRMACRO(a) _INSTRMACRO (a)
111 111
112#if !defined(_USRDLL) || defined(AUTOINIT_FUNCS_DECLARE_STATIC_REG) 112#if ! defined(_USRDLL) || defined(AUTOINIT_FUNCS_DECLARE_STATIC_REG)
113 113
114/* required for atexit() */ 114/* required for atexit() */
115#include <stdlib.h> 115#include <stdlib.h>
@@ -128,15 +128,16 @@
128#define W32_VARDECORPEFIXSTR "" 128#define W32_VARDECORPEFIXSTR ""
129#elif defined(_M_IX86) || defined(_X86_) 129#elif defined(_M_IX86) || defined(_X86_)
130#define W32_VARDECORPREFIX _ 130#define W32_VARDECORPREFIX _
131#define W32_DECORVARNAME(v) _##v 131#define W32_DECORVARNAME(v) _ ## v
132#define W32_VARDECORPEFIXSTR "_" 132#define W32_VARDECORPEFIXSTR "_"
133#else 133#else
134#error Do not know how to decorate symbols for this architecture 134#error Do not know how to decorate symbols for this architecture
135#endif 135#endif
136 136
137/* Internal variable prefix (can be any) */ 137/* Internal variable prefix (can be any) */
138#define W32_INITHELPERVARNAME(f) _initHelperDummy_##f 138#define W32_INITHELPERVARNAME(f) _initHelperDummy_ ## f
139#define W32_INITHELPERVARNAMEDECORSTR(f) W32_VARDECORPEFIXSTR _STRMACRO(W32_INITHELPERVARNAME(f)) 139#define W32_INITHELPERVARNAMEDECORSTR(f) W32_VARDECORPEFIXSTR _STRMACRO ( \
140 W32_INITHELPERVARNAME (f))
140 141
141/* Declare section (segment), put variable pointing to init function to chosen segment, 142/* Declare section (segment), put variable pointing to init function to chosen segment,
142 force linker to include variable to avoid omitting by optimizer */ 143 force linker to include variable to avoid omitting by optimizer */
@@ -145,9 +146,10 @@
145/* Return value is ignored for C++ initializers */ 146/* Return value is ignored for C++ initializers */
146/* For C initializers: startup process is aborted if initializer return non-zero */ 147/* For C initializers: startup process is aborted if initializer return non-zero */
147#define W32_FPTR_IN_SEG(S,F) \ 148#define W32_FPTR_IN_SEG(S,F) \
148 __pragma(section(S,long,read)) \ 149 __pragma (section (S,long,read)) \
149 __pragma(comment(linker, "/INCLUDE:" W32_INITHELPERVARNAMEDECORSTR(F))) \ 150 __pragma (comment (linker, "/INCLUDE:" W32_INITHELPERVARNAMEDECORSTR (F))) \
150 W32_INITVARDECL __declspec(allocate(S)) int(__cdecl *W32_INITHELPERVARNAME(F))(void) = &F 151 W32_INITVARDECL __declspec(allocate (S))int (__cdecl * W32_INITHELPERVARNAME ( \
152 F))(void) = &F
151 153
152/* Section (segment) names for pointers to initializers */ 154/* Section (segment) names for pointers to initializers */
153#define W32_SEG_INIT_C_USER ".CRT$XCU" 155#define W32_SEG_INIT_C_USER ".CRT$XCU"
@@ -161,10 +163,10 @@
161 during application startup */ 163 during application startup */
162/* "lib" initializers are called before "user" initializers */ 164/* "lib" initializers are called before "user" initializers */
163/* "C" initializers are called before "C++" initializers */ 165/* "C" initializers are called before "C++" initializers */
164#define W32_REG_INIT_C_USER(F) W32_FPTR_IN_SEG(W32_SEG_INIT_C_USER,F) 166#define W32_REG_INIT_C_USER(F) W32_FPTR_IN_SEG (W32_SEG_INIT_C_USER,F)
165#define W32_REG_INIT_C_LIB(F) W32_FPTR_IN_SEG(W32_SEG_INIT_C_LIB,F) 167#define W32_REG_INIT_C_LIB(F) W32_FPTR_IN_SEG (W32_SEG_INIT_C_LIB,F)
166#define W32_REG_INIT_CXX_USER(F) W32_FPTR_IN_SEG(W32_SEG_INIT_CXX_USER,F) 168#define W32_REG_INIT_CXX_USER(F) W32_FPTR_IN_SEG (W32_SEG_INIT_CXX_USER,F)
167#define W32_REG_INIT_CXX_LIB(F) W32_FPTR_IN_SEG(W32_SEG_INIT_CXX_LIB,F) 169#define W32_REG_INIT_CXX_LIB(F) W32_FPTR_IN_SEG (W32_SEG_INIT_CXX_LIB,F)
168 170
169/* Choose main register macro based on language and program type */ 171/* Choose main register macro based on language and program type */
170/* Assuming that _LIB or _USRDLL is defined for static or DLL-library */ 172/* Assuming that _LIB or _USRDLL is defined for static or DLL-library */
@@ -174,16 +176,18 @@
174/* Define AUTOINIT_FUNCS_FORCE_USER_LVL_INIT to register initializers 176/* Define AUTOINIT_FUNCS_FORCE_USER_LVL_INIT to register initializers
175 at user level even if building library */ 177 at user level even if building library */
176#ifdef __cplusplus 178#ifdef __cplusplus
177#if ((defined(_LIB) && !defined(_CONSOLE)) || defined(_USRDLL)) && !defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT) 179#if ((defined(_LIB) && ! defined(_CONSOLE)) || defined(_USRDLL)) && \
178#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_LIB(F) 180 ! defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT)
181#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_LIB (F)
179#else /* ! _LIB && ! _DLL */ 182#else /* ! _LIB && ! _DLL */
180#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_USER(F) 183#define W32_REGISTER_INIT(F) W32_REG_INIT_CXX_USER (F)
181#endif /* ! _LIB && ! _DLL */ 184#endif /* ! _LIB && ! _DLL */
182#else /* !__cplusplus*/ 185#else /* !__cplusplus*/
183#if ((defined(_LIB) && !defined(_CONSOLE)) || defined(_USRDLL)) && !defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT) 186#if ((defined(_LIB) && ! defined(_CONSOLE)) || defined(_USRDLL)) && \
184#define W32_REGISTER_INIT(F) W32_REG_INIT_C_LIB(F) 187 ! defined(AUTOINIT_FUNCS_FORCE_USER_LVL_INIT)
188#define W32_REGISTER_INIT(F) W32_REG_INIT_C_LIB (F)
185#else /* ! _LIB && ! _DLL */ 189#else /* ! _LIB && ! _DLL */
186#define W32_REGISTER_INIT(F) W32_REG_INIT_C_USER(F) 190#define W32_REGISTER_INIT(F) W32_REG_INIT_C_USER (F)
187#endif /* ! _LIB && ! _DLL */ 191#endif /* ! _LIB && ! _DLL */
188#endif /* !__cplusplus*/ 192#endif /* !__cplusplus*/
189 193
@@ -197,36 +201,36 @@
197#endif /* _USRDLL */ 201#endif /* _USRDLL */
198 202
199 203
200#if !defined(_USRDLL) || defined(AUTOINIT_FUNCS_FORCE_STATIC_REG) 204#if ! defined(_USRDLL) || defined(AUTOINIT_FUNCS_FORCE_STATIC_REG)
201#define W32_SET_INIT_AND_DEINIT(FI,FD) \ 205#define W32_SET_INIT_AND_DEINIT(FI,FD) \
202 void __cdecl _W32_deinit_helper_##FD(void) \ 206 void __cdecl _W32_deinit_helper_ ## FD (void) \
203 { (void)(FD)(); } \ 207 { (void) (FD) (); } \
204 int __cdecl _W32_init_helper_##FI(void) \ 208 int __cdecl _W32_init_helper_ ## FI (void) \
205 { (void)(FI)(); atexit(_W32_deinit_helper_##FD); return 0; } \ 209 { (void) (FI) (); atexit (_W32_deinit_helper_ ## FD); return 0; } \
206 W32_REGISTER_INIT(_W32_init_helper_##FI) 210 W32_REGISTER_INIT (_W32_init_helper_ ## FI)
207#else /* _USRDLL */ 211#else /* _USRDLL */
208 212
209/* If DllMain is already present in code, define AUTOINIT_FUNCS_CALL_USR_DLLMAIN 213/* If DllMain is already present in code, define AUTOINIT_FUNCS_CALL_USR_DLLMAIN
210 and rename DllMain to usr_DllMain */ 214 and rename DllMain to usr_DllMain */
211#ifndef AUTOINIT_FUNCS_CALL_USR_DLLMAIN 215#ifndef AUTOINIT_FUNCS_CALL_USR_DLLMAIN
212#define W32_SET_INIT_AND_DEINIT(FI,FD) \ 216#define W32_SET_INIT_AND_DEINIT(FI,FD) \
213 BOOL WINAPI DllMain(HINSTANCE hinst,DWORD reason,LPVOID unused) \ 217 BOOL WINAPI DllMain (HINSTANCE hinst,DWORD reason,LPVOID unused) \
214 { if(DLL_PROCESS_ATTACH==reason) {(void)(FI)();} \ 218 { if (DLL_PROCESS_ATTACH==reason) {(void) (FI) ();} \
215 else if(DLL_PROCESS_DETACH==reason) {(void)(FD)();} \ 219 else if (DLL_PROCESS_DETACH==reason) {(void) (FD) ();} \
216 return TRUE; \ 220 return TRUE; \
217 } struct _W32_dummy_strc_##FI{int i;} 221 } struct _W32_dummy_strc_ ## FI {int i;}
218#else /* AUTOINIT_FUNCS_CALL_USR_DLLMAIN */ 222#else /* AUTOINIT_FUNCS_CALL_USR_DLLMAIN */
219#define W32_SET_INIT_AND_DEINIT(FI,FD) \ 223#define W32_SET_INIT_AND_DEINIT(FI,FD) \
220 BOOL WINAPI usr_DllMain(HINSTANCE hinst,DWORD reason,LPVOID unused); \ 224 BOOL WINAPI usr_DllMain (HINSTANCE hinst,DWORD reason,LPVOID unused); \
221 BOOL WINAPI DllMain(HINSTANCE hinst,DWORD reason,LPVOID unused) \ 225 BOOL WINAPI DllMain (HINSTANCE hinst,DWORD reason,LPVOID unused) \
222 { if(DLL_PROCESS_ATTACH==reason) {(void)(FI)();} \ 226 { if (DLL_PROCESS_ATTACH==reason) {(void) (FI) ();} \
223 else if(DLL_PROCESS_DETACH==reason) {(void)(FD)();} \ 227 else if (DLL_PROCESS_DETACH==reason) {(void) (FD) ();} \
224 return usr_DllMain(hinst,reason,unused); \ 228 return usr_DllMain (hinst,reason,unused); \
225 } struct _W32_dummy_strc_##FI{int i;} 229 } struct _W32_dummy_strc_ ## FI {int i;}
226#endif /* AUTOINIT_FUNCS_CALL_USR_DLLMAIN */ 230#endif /* AUTOINIT_FUNCS_CALL_USR_DLLMAIN */
227#endif /* _USRDLL */ 231#endif /* _USRDLL */
228 232
229#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) W32_SET_INIT_AND_DEINIT(FI,FD) 233#define _SET_INIT_AND_DEINIT_FUNCS(FI,FD) W32_SET_INIT_AND_DEINIT (FI,FD)
230/* Indicate that automatic initializers/deinitializers are supported */ 234/* Indicate that automatic initializers/deinitializers are supported */
231#define _AUTOINIT_FUNCS_ARE_SUPPORTED 1 235#define _AUTOINIT_FUNCS_ARE_SUPPORTED 1
232 236
@@ -235,7 +239,8 @@
235/* Define EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED before inclusion of header to 239/* Define EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED before inclusion of header to
236 abort compilation if automatic initializers/deinitializers are not supported */ 240 abort compilation if automatic initializers/deinitializers are not supported */
237#ifdef EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED 241#ifdef EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED
238#error Compiler/platform don not support automatic calls of user-defined initializer and deinitializer 242#error \
243 Compiler/platform don not support automatic calls of user-defined initializer and deinitializer
239#endif /* EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED */ 244#endif /* EMIT_ERROR_IF_AUTOINIT_FUNCS_ARE_NOT_SUPPORTED */
240 245
241/* Do nothing */ 246/* Do nothing */
diff --git a/src/include/mhd_options.h b/src/include/mhd_options.h
index 47b7ce0e..26ab49e1 100644
--- a/src/include/mhd_options.h
+++ b/src/include/mhd_options.h
@@ -45,7 +45,7 @@
45 45
46#ifndef _MHD_EXTERN 46#ifndef _MHD_EXTERN
47#if defined(BUILDING_MHD_LIB) && defined(_WIN32) && \ 47#if defined(BUILDING_MHD_LIB) && defined(_WIN32) && \
48 (defined(DLL_EXPORT) || defined(MHD_W32DLL)) 48 (defined(DLL_EXPORT) || defined(MHD_W32DLL))
49#define _MHD_EXTERN __declspec(dllexport) extern 49#define _MHD_EXTERN __declspec(dllexport) extern
50#else /* !BUILDING_MHD_LIB || !_WIN32 || (!DLL_EXPORT && !MHD_W32DLL) */ 50#else /* !BUILDING_MHD_LIB || !_WIN32 || (!DLL_EXPORT && !MHD_W32DLL) */
51#define _MHD_EXTERN extern 51#define _MHD_EXTERN extern
@@ -66,7 +66,7 @@
66#endif /* !FD_SETSIZE && !W32 */ 66#endif /* !FD_SETSIZE && !W32 */
67 67
68#if defined(HAVE_LINUX_SENDFILE) || defined(HAVE_FREEBSD_SENDFILE) || \ 68#if defined(HAVE_LINUX_SENDFILE) || defined(HAVE_FREEBSD_SENDFILE) || \
69 defined(HAVE_DARWIN_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE) 69 defined(HAVE_DARWIN_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE)
70/* Have any supported sendfile() function. */ 70/* Have any supported sendfile() function. */
71#define _MHD_HAVE_SENDFILE 71#define _MHD_HAVE_SENDFILE
72#endif /* HAVE_LINUX_SENDFILE || HAVE_FREEBSD_SENDFILE || 72#endif /* HAVE_LINUX_SENDFILE || HAVE_FREEBSD_SENDFILE ||
@@ -104,7 +104,8 @@
104#define RESTRICT __restrict__ 104#define RESTRICT __restrict__
105#endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */ 105#endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */
106 106
107#if LINUX+0 && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && ! defined(_LARGEFILE64_SOURCE) 107#if LINUX + 0 && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && \
108 ! defined(_LARGEFILE64_SOURCE)
108/* On Linux, special macro is required to enable definitions of some xxx64 functions */ 109/* On Linux, special macro is required to enable definitions of some xxx64 functions */
109#define _LARGEFILE64_SOURCE 1 110#define _LARGEFILE64_SOURCE 1
110#endif 111#endif
@@ -115,12 +116,13 @@
115#endif /* HAVE_C11_GMTIME_S */ 116#endif /* HAVE_C11_GMTIME_S */
116 117
117#if defined(MHD_FAVOR_FAST_CODE) && defined(MHD_FAVOR_SMALL_CODE) 118#if defined(MHD_FAVOR_FAST_CODE) && defined(MHD_FAVOR_SMALL_CODE)
118#error MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot favor speed and size at the same time. 119#error \
120 MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot favor speed and size at the same time.
119#endif /* MHD_FAVOR_FAST_CODE && MHD_FAVOR_SMALL_CODE */ 121#endif /* MHD_FAVOR_FAST_CODE && MHD_FAVOR_SMALL_CODE */
120 122
121/* Define MHD_FAVOR_FAST_CODE to force fast code path or 123/* Define MHD_FAVOR_FAST_CODE to force fast code path or
122 define MHD_FAVOR_SMALL_CODE to choose compact code path */ 124 define MHD_FAVOR_SMALL_CODE to choose compact code path */
123#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE) 125#if ! defined(MHD_FAVOR_FAST_CODE) && ! defined(MHD_FAVOR_SMALL_CODE)
124/* Try to detect user preferences */ 126/* Try to detect user preferences */
125/* Defined by GCC and many compatible compilers */ 127/* Defined by GCC and many compatible compilers */
126#if defined(__OPTIMIZE_SIZE__) 128#if defined(__OPTIMIZE_SIZE__)
@@ -130,7 +132,7 @@
130#endif /* __OPTIMIZE__ */ 132#endif /* __OPTIMIZE__ */
131#endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */ 133#endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */
132 134
133#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE) 135#if ! defined(MHD_FAVOR_FAST_CODE) && ! defined(MHD_FAVOR_SMALL_CODE)
134/* Use faster code by default */ 136/* Use faster code by default */
135#define MHD_FAVOR_FAST_CODE 1 137#define MHD_FAVOR_FAST_CODE 1
136#endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */ 138#endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */
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/**
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/**
diff --git a/src/include/microhttpd_tls.h b/src/include/microhttpd_tls.h
index f5b48522..7bd7d477 100644
--- a/src/include/microhttpd_tls.h
+++ b/src/include/microhttpd_tls.h
@@ -54,9 +54,9 @@ struct MHD_TLS_Plugin
54{ 54{
55 /** 55 /**
56 * Closure with plugin's internal state, opaque to MHD. 56 * Closure with plugin's internal state, opaque to MHD.
57 */ 57 */
58 void *cls; 58 void *cls;
59 59
60 /** 60 /**
61 * Destroy the plugin, we are done with it. 61 * Destroy the plugin, we are done with it.
62 */ 62 */
@@ -77,9 +77,9 @@ struct MHD_TLS_Plugin
77 */ 77 */
78 enum MHD_StatusCode 78 enum MHD_StatusCode
79 (*init_kcp)(void *cls, 79 (*init_kcp)(void *cls,
80 const char *mem_key, 80 const char *mem_key,
81 const char *mem_cert, 81 const char *mem_cert,
82 const char *pass); 82 const char *pass);
83 83
84 84
85 /** 85 /**
@@ -91,7 +91,7 @@ struct MHD_TLS_Plugin
91 */ 91 */
92 enum MHD_StatusCode 92 enum MHD_StatusCode
93 (*init_dhparams)(void *cls, 93 (*init_dhparams)(void *cls,
94 const char *dh); 94 const char *dh);
95 95
96 96
97 /** 97 /**
@@ -103,7 +103,7 @@ struct MHD_TLS_Plugin
103 */ 103 */
104 enum MHD_StatusCode 104 enum MHD_StatusCode
105 (*init_mem_trust)(void *cls, 105 (*init_mem_trust)(void *cls,
106 const char *mem_trust); 106 const char *mem_trust);
107 107
108 108
109 /** 109 /**
@@ -116,59 +116,59 @@ struct MHD_TLS_Plugin
116 */ 116 */
117 struct MHD_TLS_ConnectionState * 117 struct MHD_TLS_ConnectionState *
118 (*setup_connection)(void *cls, 118 (*setup_connection)(void *cls,
119 ...); 119 ...);
120 120
121 121
122 enum MHD_Bool 122 enum MHD_Bool
123 (*handshake)(void *cls, 123 (*handshake)(void *cls,
124 struct MHD_TLS_ConnectionState *cs); 124 struct MHD_TLS_ConnectionState *cs);
125 125
126 126
127 enum MHD_Bool 127 enum MHD_Bool
128 (*idle_ready)(void *cls, 128 (*idle_ready)(void *cls,
129 struct MHD_TLS_ConnectionState *cs); 129 struct MHD_TLS_ConnectionState *cs);
130 130
131 131
132 enum MHD_Bool 132 enum MHD_Bool
133 (*update_event_loop_info)(void *cls, 133 (*update_event_loop_info)(void *cls,
134 struct MHD_TLS_ConnectionState *cs, 134 struct MHD_TLS_ConnectionState *cs,
135 enum MHD_RequestEventLoopInfo *eli); 135 enum MHD_RequestEventLoopInfo *eli);
136 136
137 ssize_t 137 ssize_t
138 (*send)(void *cls, 138 (*send)(void *cls,
139 struct MHD_TLS_ConnectionState *cs, 139 struct MHD_TLS_ConnectionState *cs,
140 const void *buf, 140 const void *buf,
141 size_t buf_size); 141 size_t buf_size);
142 142
143 143
144 ssize_t 144 ssize_t
145 (*recv)(void *cls, 145 (*recv)(void *cls,
146 struct MHD_TLS_ConnectionState *cs, 146 struct MHD_TLS_ConnectionState *cs,
147 void *buf, 147 void *buf,
148 size_t buf_size); 148 size_t buf_size);
149 149
150 150
151 const char * 151 const char *
152 (*strerror)(void *cls, 152 (*strerror)(void *cls,
153 int ec); 153 int ec);
154 154
155 enum MHD_Bool 155 enum MHD_Bool
156 (*check_record_pending)(void *cls, 156 (*check_record_pending)(void *cls,
157 struct MHD_TLS_ConnectionState *cs); 157 struct MHD_TLS_ConnectionState *cs);
158 158
159 enum MHD_Bool 159 enum MHD_Bool
160 (*shutdown_connection) (void *cls, 160 (*shutdown_connection)(void *cls,
161 struct MHD_TLS_ConnectionState *cs); 161 struct MHD_TLS_ConnectionState *cs);
162
162 163
163
164 void 164 void
165 (*teardown_connection)(void *cls, 165 (*teardown_connection)(void *cls,
166 struct MHD_TLS_ConnectionState *cs); 166 struct MHD_TLS_ConnectionState *cs);
167 167
168 /** 168 /**
169 * TODO: More functions here.... 169 * TODO: More functions here....
170 */ 170 */
171 171
172}; 172};
173 173
174 174
@@ -191,7 +191,7 @@ typedef struct MHD_TLS_Plugin *
191 */ 191 */
192#define MHD_TLS_INIT(body) \ 192#define MHD_TLS_INIT(body) \
193 struct MHD_TLS_Plugin * \ 193 struct MHD_TLS_Plugin * \
194 MHD_TLS_init_ ## MHD_TLS_ABI_VERSION (const char *ciphers) \\ 194 MHD_TLS_init_ ## MHD_TLS_ABI_VERSION (const char *ciphers) \ \
195 { body } 195 { body }
196 196
197#endif 197#endif
diff --git a/src/include/platform.h b/src/include/platform.h
index 20d4df52..05fe1cd4 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -94,7 +94,7 @@
94#if HAVE_SYS_SOCKET_H 94#if HAVE_SYS_SOCKET_H
95#include <sys/socket.h> 95#include <sys/socket.h>
96#endif 96#endif
97#if defined(_WIN32) && !defined(__CYGWIN__) 97#if defined(_WIN32) && ! defined(__CYGWIN__)
98#ifndef WIN32_LEAN_AND_MEAN 98#ifndef WIN32_LEAN_AND_MEAN
99/* Do not include unneeded parts of W32 headers. */ 99/* Do not include unneeded parts of W32 headers. */
100#define WIN32_LEAN_AND_MEAN 1 100#define WIN32_LEAN_AND_MEAN 1
@@ -103,28 +103,28 @@
103#include <ws2tcpip.h> 103#include <ws2tcpip.h>
104#endif /* _WIN32 && !__CYGWIN__ */ 104#endif /* _WIN32 && !__CYGWIN__ */
105 105
106#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET) 106#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
107/* Do not define __USE_W32_SOCKETS under Cygwin! */ 107/* Do not define __USE_W32_SOCKETS under Cygwin! */
108#error Cygwin with winsock fd_set is not supported 108#error Cygwin with winsock fd_set is not supported
109#endif 109#endif
110 110
111#if defined(_WIN32) && !defined(__CYGWIN__) 111#if defined(_WIN32) && ! defined(__CYGWIN__)
112#define sleep(seconds) ((SleepEx((seconds)*1000, 1)==0)?0:(seconds)) 112#define sleep(seconds) ((SleepEx ((seconds) * 1000, 1)==0) ? 0 : (seconds))
113#define usleep(useconds) ((SleepEx((useconds)/1000, 1)==0)?0:-1) 113#define usleep(useconds) ((SleepEx ((useconds) / 1000, 1)==0) ? 0 : -1)
114#endif 114#endif
115 115
116#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED) 116#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED)
117#define _SSIZE_T_DEFINED 117#define _SSIZE_T_DEFINED
118typedef intptr_t ssize_t; 118typedef intptr_t ssize_t;
119#endif /* !_SSIZE_T_DEFINED */ 119#endif /* !_SSIZE_T_DEFINED */
120 120
121#if !defined(_WIN32) || defined(__CYGWIN__) 121#if ! defined(_WIN32) || defined(__CYGWIN__)
122typedef time_t _MHD_TIMEVAL_TV_SEC_TYPE; 122typedef time_t _MHD_TIMEVAL_TV_SEC_TYPE;
123#else /* _WIN32 && ! __CYGWIN__ */ 123#else /* _WIN32 && ! __CYGWIN__ */
124typedef long _MHD_TIMEVAL_TV_SEC_TYPE; 124typedef long _MHD_TIMEVAL_TV_SEC_TYPE;
125#endif /* _WIN32 && ! __CYGWIN__ */ 125#endif /* _WIN32 && ! __CYGWIN__ */
126 126
127#if !defined(IPPROTO_IPV6) && defined(_MSC_FULL_VER) && _WIN32_WINNT >= 0x0501 127#if ! defined(IPPROTO_IPV6) && defined(_MSC_FULL_VER) && _WIN32_WINNT >= 0x0501
128/* VC use IPPROTO_IPV6 as part of enum */ 128/* VC use IPPROTO_IPV6 as part of enum */
129#define IPPROTO_IPV6 IPPROTO_IPV6 129#define IPPROTO_IPV6 IPPROTO_IPV6
130#endif 130#endif