GNU libmicrohttpd  0.9.66
microhttpd.h
Go to the documentation of this file.
1 /*
2  This file is part of libmicrohttpd
3  Copyright (C) 2006--2019 Christian Grothoff (and other contributing authors)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
79 #ifndef MHD_MICROHTTPD_H
80 #define MHD_MICROHTTPD_H
81 
82 #ifdef __cplusplus
83 extern "C"
84 {
85 #if 0 /* keep Emacsens' auto-indent happy */
86 }
87 #endif
88 #endif
89 
90 /* While we generally would like users to use a configure-driven
91  build process which detects which headers are present and
92  hence works on any platform, we use "standard" includes here
93  to build out-of-the-box for beginning users on common systems.
94 
95  If generic headers don't work on your platform, include headers
96  which define 'va_list', 'size_t', 'ssize_t', 'intptr_t',
97  'uint16_t', 'uint32_t', 'uint64_t', 'off_t', 'struct sockaddr',
98  'socklen_t', 'fd_set' and "#define MHD_PLATFORM_H" before
99  including "microhttpd.h". Then the following "standard"
100  includes won't be used (which might be a good idea, especially
101  on platforms where they do not exist).
102  */
103 #ifndef MHD_PLATFORM_H
104 #if defined(_WIN32) && ! defined(__CYGWIN__) && \
105  ! defined(_CRT_DECLARE_NONSTDC_NAMES)
106 #define _CRT_DECLARE_NONSTDC_NAMES 1
107 #endif /* _WIN32 && ! __CYGWIN__ && ! _CRT_DECLARE_NONSTDC_NAMES */
108 #include <stdarg.h>
109 #include <stdint.h>
110 #include <sys/types.h>
111 #if !defined(_WIN32) || defined(__CYGWIN__)
112 #include <unistd.h>
113 #include <sys/time.h>
114 #include <sys/socket.h>
115 #else /* _WIN32 && ! __CYGWIN__ */
116 /* Declare POSIX-compatible names */
117 #define _CRT_DECLARE_NONSTDC_NAMES 1
118 #include <ws2tcpip.h>
119 #if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
120 #define _SSIZE_T_DEFINED
121 typedef intptr_t ssize_t;
122 #endif /* !_SSIZE_T_DEFINED */
123 #endif /* _WIN32 && ! __CYGWIN__ */
124 #endif
125 
126 #if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
127 /* Do not define __USE_W32_SOCKETS under Cygwin! */
128 #error Cygwin with winsock fd_set is not supported
129 #endif
130 
135 #define MHD_VERSION 0x00096600
136 
140 #define MHD_YES 1
141 
145 #define MHD_NO 0
146 
150 #define MHD_INVALID_NONCE -1
151 
156 #ifdef UINT64_MAX
157 #define MHD_SIZE_UNKNOWN UINT64_MAX
158 #else
159 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
160 #endif
161 
162 #ifdef SIZE_MAX
163 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
164 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
165 #else
166 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
167 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
168 #endif
169 
170 #ifndef _MHD_EXTERN
171 #if defined(_WIN32) && defined(MHD_W32LIB)
172 #define _MHD_EXTERN extern
173 #elif defined (_WIN32) && defined(MHD_W32DLL)
174 /* Define MHD_W32DLL when using MHD as W32 .DLL to speed up linker a little */
175 #define _MHD_EXTERN __declspec(dllimport)
176 #else
177 #define _MHD_EXTERN extern
178 #endif
179 #endif
180 
181 #ifndef MHD_SOCKET_DEFINED
182 
185 #if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
186 #define MHD_POSIX_SOCKETS 1
187 typedef int MHD_socket;
188 #define MHD_INVALID_SOCKET (-1)
189 #else /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
190 #define MHD_WINSOCK_SOCKETS 1
191 #include <winsock2.h>
192 typedef SOCKET MHD_socket;
193 #define MHD_INVALID_SOCKET (INVALID_SOCKET)
194 #endif /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
195 #define MHD_SOCKET_DEFINED 1
196 #endif /* MHD_SOCKET_DEFINED */
197 
201 #ifdef MHD_NO_DEPRECATION
202 #define _MHD_DEPR_MACRO(msg)
203 #define _MHD_NO_DEPR_IN_MACRO 1
204 #define _MHD_DEPR_IN_MACRO(msg)
205 #define _MHD_NO_DEPR_FUNC 1
206 #define _MHD_DEPR_FUNC(msg)
207 #endif /* MHD_NO_DEPRECATION */
208 
209 #ifndef _MHD_DEPR_MACRO
210 #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500
211 /* VS 2008 or later */
212 /* Stringify macros */
213 #define _MHD_INSTRMACRO(a) #a
214 #define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a)
215 /* deprecation message */
216 #define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg))
217 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
218 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
219 /* clang or GCC since 3.0 */
220 #define _MHD_GCC_PRAG(x) _Pragma (#x)
221 #if (defined(__clang__) && (__clang_major__+0 >= 5 || \
222  (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) || \
223  __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8)
224 /* clang >= 3.3 (or XCode's clang >= 5.0) or
225  GCC >= 4.8 */
226 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg)
227 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
228 #else /* older clang or GCC */
229 /* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
230 #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 */
232 /* clang handles inline pragmas better than GCC */
233 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
234 #endif /* clang >= 2.9 */
235 #endif /* older clang or GCC */
236 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
237 #endif /* clang || GCC >= 3.0 */
238 #endif /* !_MHD_DEPR_MACRO */
239 
240 #ifndef _MHD_DEPR_MACRO
241 #define _MHD_DEPR_MACRO(msg)
242 #endif /* !_MHD_DEPR_MACRO */
243 
244 #ifndef _MHD_DEPR_IN_MACRO
245 #define _MHD_NO_DEPR_IN_MACRO 1
246 #define _MHD_DEPR_IN_MACRO(msg)
247 #endif /* !_MHD_DEPR_IN_MACRO */
248 
249 #ifndef _MHD_DEPR_FUNC
250 #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400
251 /* VS 2005 or later */
252 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg))
253 #elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310
254 /* VS .NET 2003 deprecation do not support custom messages */
255 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
256 #elif (__GNUC__+0 >= 5) || (defined (__clang__) && \
257  (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: earlier versions not tested */
258 /* GCC >= 5.0 or clang >= 2.9 */
259 #define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg)))
260 #elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1)
261 /* 3.1 <= GCC < 5.0 or clang < 2.9 */
262 /* old GCC-style deprecation do not support custom messages */
263 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
264 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
265 #endif /* clang < 2.9 || GCC >= 3.1 */
266 #endif /* !_MHD_DEPR_FUNC */
267 
268 #ifndef _MHD_DEPR_FUNC
269 #define _MHD_NO_DEPR_FUNC 1
270 #define _MHD_DEPR_FUNC(msg)
271 #endif /* !_MHD_DEPR_FUNC */
272 
278 #ifndef MHD_LONG_LONG
279 
282 #define MHD_LONG_LONG long long
283 #define MHD_UNSIGNED_LONG_LONG unsigned long long
284 #else /* MHD_LONG_LONG */
285 _MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
286 #endif
287 
291 #ifndef MHD_LONG_LONG_PRINTF
292 
295 #define MHD_LONG_LONG_PRINTF "ll"
296 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
297 #else /* MHD_LONG_LONG_PRINTF */
298 _MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
299 #endif
300 
301 
305 #define MHD_MD5_DIGEST_SIZE 16
306 
307 
316 /* 100 "Continue". RFC7231, Section 6.2.1. */
317 #define MHD_HTTP_CONTINUE 100
318 /* 101 "Switching Protocols". RFC7231, Section 6.2.2. */
319 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
320 /* 102 "Processing". RFC2518. */
321 #define MHD_HTTP_PROCESSING 102
322 /* 103 "Early Hints". RFC8297. */
323 #define MHD_HTTP_EARLY_HINTS 103
324 
325 /* 200 "OK". RFC7231, Section 6.3.1. */
326 #define MHD_HTTP_OK 200
327 /* 201 "Created". RFC7231, Section 6.3.2. */
328 #define MHD_HTTP_CREATED 201
329 /* 202 "Accepted". RFC7231, Section 6.3.3. */
330 #define MHD_HTTP_ACCEPTED 202
331 /* 203 "Non-Authoritative Information". RFC7231, Section 6.3.4. */
332 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
333 /* 204 "No Content". RFC7231, Section 6.3.5. */
334 #define MHD_HTTP_NO_CONTENT 204
335 /* 205 "Reset Content". RFC7231, Section 6.3.6. */
336 #define MHD_HTTP_RESET_CONTENT 205
337 /* 206 "Partial Content". RFC7233, Section 4.1. */
338 #define MHD_HTTP_PARTIAL_CONTENT 206
339 /* 207 "Multi-Status". RFC4918. */
340 #define MHD_HTTP_MULTI_STATUS 207
341 /* 208 "Already Reported". RFC5842. */
342 #define MHD_HTTP_ALREADY_REPORTED 208
343 
344 /* 226 "IM Used". RFC3229. */
345 #define MHD_HTTP_IM_USED 226
346 
347 /* 300 "Multiple Choices". RFC7231, Section 6.4.1. */
348 #define MHD_HTTP_MULTIPLE_CHOICES 300
349 /* 301 "Moved Permanently". RFC7231, Section 6.4.2. */
350 #define MHD_HTTP_MOVED_PERMANENTLY 301
351 /* 302 "Found". RFC7231, Section 6.4.3. */
352 #define MHD_HTTP_FOUND 302
353 /* 303 "See Other". RFC7231, Section 6.4.4. */
354 #define MHD_HTTP_SEE_OTHER 303
355 /* 304 "Not Modified". RFC7232, Section 4.1. */
356 #define MHD_HTTP_NOT_MODIFIED 304
357 /* 305 "Use Proxy". RFC7231, Section 6.4.5. */
358 #define MHD_HTTP_USE_PROXY 305
359 /* 306 "Switch Proxy". Not used! RFC7231, Section 6.4.6. */
360 #define MHD_HTTP_SWITCH_PROXY 306
361 /* 307 "Temporary Redirect". RFC7231, Section 6.4.7. */
362 #define MHD_HTTP_TEMPORARY_REDIRECT 307
363 /* 308 "Permanent Redirect". RFC7538. */
364 #define MHD_HTTP_PERMANENT_REDIRECT 308
365 
366 /* 400 "Bad Request". RFC7231, Section 6.5.1. */
367 #define MHD_HTTP_BAD_REQUEST 400
368 /* 401 "Unauthorized". RFC7235, Section 3.1. */
369 #define MHD_HTTP_UNAUTHORIZED 401
370 /* 402 "Payment Required". RFC7231, Section 6.5.2. */
371 #define MHD_HTTP_PAYMENT_REQUIRED 402
372 /* 403 "Forbidden". RFC7231, Section 6.5.3. */
373 #define MHD_HTTP_FORBIDDEN 403
374 /* 404 "Not Found". RFC7231, Section 6.5.4. */
375 #define MHD_HTTP_NOT_FOUND 404
376 /* 405 "Method Not Allowed". RFC7231, Section 6.5.5. */
377 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
378 /* 406 "Not Acceptable". RFC7231, Section 6.5.6. */
379 #define MHD_HTTP_NOT_ACCEPTABLE 406
380 /* 407 "Proxy Authentication Required". RFC7235, Section 3.2. */
381 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
382 /* 408 "Request Timeout". RFC7231, Section 6.5.7. */
383 #define MHD_HTTP_REQUEST_TIMEOUT 408
384 /* 409 "Conflict". RFC7231, Section 6.5.8. */
385 #define MHD_HTTP_CONFLICT 409
386 /* 410 "Gone". RFC7231, Section 6.5.9. */
387 #define MHD_HTTP_GONE 410
388 /* 411 "Length Required". RFC7231, Section 6.5.10. */
389 #define MHD_HTTP_LENGTH_REQUIRED 411
390 /* 412 "Precondition Failed". RFC7232, Section 4.2; RFC8144, Section 3.2. */
391 #define MHD_HTTP_PRECONDITION_FAILED 412
392 /* 413 "Payload Too Large". RFC7231, Section 6.5.11. */
393 #define MHD_HTTP_PAYLOAD_TOO_LARGE 413
394 /* 414 "URI Too Long". RFC7231, Section 6.5.12. */
395 #define MHD_HTTP_URI_TOO_LONG 414
396 /* 415 "Unsupported Media Type". RFC7231, Section 6.5.13; RFC7694, Section 3. */
397 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
398 /* 416 "Range Not Satisfiable". RFC7233, Section 4.4. */
399 #define MHD_HTTP_RANGE_NOT_SATISFIABLE 416
400 /* 417 "Expectation Failed". RFC7231, Section 6.5.14. */
401 #define MHD_HTTP_EXPECTATION_FAILED 417
402 
403 /* 421 "Misdirected Request". RFC7540, Section 9.1.2. */
404 #define MHD_HTTP_MISDIRECTED_REQUEST 421
405 /* 422 "Unprocessable Entity". RFC4918. */
406 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
407 /* 423 "Locked". RFC4918. */
408 #define MHD_HTTP_LOCKED 423
409 /* 424 "Failed Dependency". RFC4918. */
410 #define MHD_HTTP_FAILED_DEPENDENCY 424
411 /* 425 "Too Early". RFC8470. */
412 #define MHD_HTTP_TOO_EARLY 425
413 /* 426 "Upgrade Required". RFC7231, Section 6.5.15. */
414 #define MHD_HTTP_UPGRADE_REQUIRED 426
415 
416 /* 428 "Precondition Required". RFC6585. */
417 #define MHD_HTTP_PRECONDITION_REQUIRED 428
418 /* 429 "Too Many Requests". RFC6585. */
419 #define MHD_HTTP_TOO_MANY_REQUESTS 429
420 
421 /* 431 "Request Header Fields Too Large". RFC6585. */
422 #define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
423 
424 /* 451 "Unavailable For Legal Reasons". RFC7725. */
425 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
426 
427 /* 500 "Internal Server Error". RFC7231, Section 6.6.1. */
428 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
429 /* 501 "Not Implemented". RFC7231, Section 6.6.2. */
430 #define MHD_HTTP_NOT_IMPLEMENTED 501
431 /* 502 "Bad Gateway". RFC7231, Section 6.6.3. */
432 #define MHD_HTTP_BAD_GATEWAY 502
433 /* 503 "Service Unavailable". RFC7231, Section 6.6.4. */
434 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
435 /* 504 "Gateway Timeout". RFC7231, Section 6.6.5. */
436 #define MHD_HTTP_GATEWAY_TIMEOUT 504
437 /* 505 "HTTP Version Not Supported". RFC7231, Section 6.6.6. */
438 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
439 /* 506 "Variant Also Negotiates". RFC2295. */
440 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
441 /* 507 "Insufficient Storage". RFC4918. */
442 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
443 /* 508 "Loop Detected". RFC5842. */
444 #define MHD_HTTP_LOOP_DETECTED 508
445 
446 /* 510 "Not Extended". RFC2774. */
447 #define MHD_HTTP_NOT_EXTENDED 510
448 /* 511 "Network Authentication Required". RFC6585. */
449 #define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
450 
451 
452 /* Not registered non-standard codes */
453 /* 449 "Reply With". MS IIS extension. */
454 #define MHD_HTTP_RETRY_WITH 449
455 
456 /* 450 "Blocked by Windows Parental Controls". MS extension. */
457 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
458 
459 /* 509 "Bandwidth Limit Exceeded". Apache extension. */
460 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
461 
462 
463 /* Deprecated codes */
465 #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
467 
469 #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
471 
473 #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
475 
477 #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
479 
481 #define MHD_HTTP_UNORDERED_COLLECTION \
482  _MHD_DEPR_IN_MACRO("Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") 425
483 
485 #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
487 
488  /* end of group httpcode */
490 
497 _MHD_EXTERN const char *
498 MHD_get_reason_phrase_for (unsigned int code);
499 
500 
507 #define MHD_ICY_FLAG ((uint32_t)(((uint32_t)1) << 31))
508 
517 /* Main HTTP headers. */
518 /* Standard. RFC7231, Section 5.3.2 */
519 #define MHD_HTTP_HEADER_ACCEPT "Accept"
520 /* Standard. RFC7231, Section 5.3.3 */
521 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
522 /* Standard. RFC7231, Section 5.3.4; RFC7694, Section 3 */
523 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
524 /* Standard. RFC7231, Section 5.3.5 */
525 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
526 /* Standard. RFC7233, Section 2.3 */
527 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
528 /* Standard. RFC7234, Section 5.1 */
529 #define MHD_HTTP_HEADER_AGE "Age"
530 /* Standard. RFC7231, Section 7.4.1 */
531 #define MHD_HTTP_HEADER_ALLOW "Allow"
532 /* Standard. RFC7235, Section 4.2 */
533 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
534 /* Standard. RFC7234, Section 5.2 */
535 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
536 /* Reserved. RFC7230, Section 8.1 */
537 #define MHD_HTTP_HEADER_CLOSE "Close"
538 /* Standard. RFC7230, Section 6.1 */
539 #define MHD_HTTP_HEADER_CONNECTION "Connection"
540 /* Standard. RFC7231, Section 3.1.2.2 */
541 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
542 /* Standard. RFC7231, Section 3.1.3.2 */
543 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
544 /* Standard. RFC7230, Section 3.3.2 */
545 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
546 /* Standard. RFC7231, Section 3.1.4.2 */
547 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
548 /* Standard. RFC7233, Section 4.2 */
549 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
550 /* Standard. RFC7231, Section 3.1.1.5 */
551 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
552 /* Standard. RFC7231, Section 7.1.1.2 */
553 #define MHD_HTTP_HEADER_DATE "Date"
554 /* Standard. RFC7232, Section 2.3 */
555 #define MHD_HTTP_HEADER_ETAG "ETag"
556 /* Standard. RFC7231, Section 5.1.1 */
557 #define MHD_HTTP_HEADER_EXPECT "Expect"
558 /* Standard. RFC7234, Section 5.3 */
559 #define MHD_HTTP_HEADER_EXPIRES "Expires"
560 /* Standard. RFC7231, Section 5.5.1 */
561 #define MHD_HTTP_HEADER_FROM "From"
562 /* Standard. RFC7230, Section 5.4 */
563 #define MHD_HTTP_HEADER_HOST "Host"
564 /* Standard. RFC7232, Section 3.1 */
565 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
566 /* Standard. RFC7232, Section 3.3 */
567 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
568 /* Standard. RFC7232, Section 3.2 */
569 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
570 /* Standard. RFC7233, Section 3.2 */
571 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
572 /* Standard. RFC7232, Section 3.4 */
573 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
574 /* Standard. RFC7232, Section 2.2 */
575 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
576 /* Standard. RFC7231, Section 7.1.2 */
577 #define MHD_HTTP_HEADER_LOCATION "Location"
578 /* Standard. RFC7231, Section 5.1.2 */
579 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
580 /* Standard. RFC7231, Appendix A.1 */
581 #define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version"
582 /* Standard. RFC7234, Section 5.4 */
583 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
584 /* Standard. RFC7235, Section 4.3 */
585 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
586 /* Standard. RFC7235, Section 4.4 */
587 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
588 /* Standard. RFC7233, Section 3.1 */
589 #define MHD_HTTP_HEADER_RANGE "Range"
590 /* Standard. RFC7231, Section 5.5.2 */
591 #define MHD_HTTP_HEADER_REFERER "Referer"
592 /* Standard. RFC7231, Section 7.1.3 */
593 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
594 /* Standard. RFC7231, Section 7.4.2 */
595 #define MHD_HTTP_HEADER_SERVER "Server"
596 /* Standard. RFC7230, Section 4.3 */
597 #define MHD_HTTP_HEADER_TE "TE"
598 /* Standard. RFC7230, Section 4.4 */
599 #define MHD_HTTP_HEADER_TRAILER "Trailer"
600 /* Standard. RFC7230, Section 3.3.1 */
601 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
602 /* Standard. RFC7230, Section 6.7 */
603 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
604 /* Standard. RFC7231, Section 5.5.3 */
605 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
606 /* Standard. RFC7231, Section 7.1.4 */
607 #define MHD_HTTP_HEADER_VARY "Vary"
608 /* Standard. RFC7230, Section 5.7.1 */
609 #define MHD_HTTP_HEADER_VIA "Via"
610 /* Standard. RFC7235, Section 4.1 */
611 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
612 /* Standard. RFC7234, Section 5.5 */
613 #define MHD_HTTP_HEADER_WARNING "Warning"
614 
615 /* Additional HTTP headers. */
616 /* No category. RFC4229 */
617 #define MHD_HTTP_HEADER_A_IM "A-IM"
618 /* No category. RFC4229 */
619 #define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions"
620 /* Informational. RFC7089 */
621 #define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime"
622 /* No category. RFC4229 */
623 #define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features"
624 /* No category. RFC5789 */
625 #define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch"
626 /* Standard. https://www.w3.org/TR/ldp/ */
627 #define MHD_HTTP_HEADER_ACCEPT_POST "Accept-Post"
628 /* Standard. RFC7639, Section 2 */
629 #define MHD_HTTP_HEADER_ALPN "ALPN"
630 /* Standard. RFC7838 */
631 #define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc"
632 /* Standard. RFC7838 */
633 #define MHD_HTTP_HEADER_ALT_USED "Alt-Used"
634 /* No category. RFC4229 */
635 #define MHD_HTTP_HEADER_ALTERNATES "Alternates"
636 /* No category. RFC4437 */
637 #define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref"
638 /* Experimental. RFC8053, Section 4 */
639 #define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control"
640 /* Standard. RFC7615, Section 3 */
641 #define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info"
642 /* No category. RFC4229 */
643 #define MHD_HTTP_HEADER_C_EXT "C-Ext"
644 /* No category. RFC4229 */
645 #define MHD_HTTP_HEADER_C_MAN "C-Man"
646 /* No category. RFC4229 */
647 #define MHD_HTTP_HEADER_C_OPT "C-Opt"
648 /* No category. RFC4229 */
649 #define MHD_HTTP_HEADER_C_PEP "C-PEP"
650 /* No category. RFC4229 */
651 #define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info"
652 /* Standard. RFC8607, Section 5.1 */
653 #define MHD_HTTP_HEADER_CAL_MANAGED_ID "Cal-Managed-ID"
654 /* Standard. RFC7809, Section 7.1 */
655 #define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
656 /* Standard. RFC8586 */
657 #define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop"
658 /* Obsoleted. RFC2068; RFC2616 */
659 #define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
660 /* Standard. RFC6266 */
661 #define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition"
662 /* No category. RFC4229 */
663 #define MHD_HTTP_HEADER_CONTENT_ID "Content-ID"
664 /* No category. RFC4229 */
665 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
666 /* No category. RFC4229 */
667 #define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type"
668 /* No category. RFC4229 */
669 #define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type"
670 /* No category. RFC4229 */
671 #define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version"
672 /* Standard. RFC6265 */
673 #define MHD_HTTP_HEADER_COOKIE "Cookie"
674 /* Obsoleted. RFC2965; RFC6265 */
675 #define MHD_HTTP_HEADER_COOKIE2 "Cookie2"
676 /* Standard. RFC5323 */
677 #define MHD_HTTP_HEADER_DASL "DASL"
678 /* Standard. RFC4918 */
679 #define MHD_HTTP_HEADER_DAV "DAV"
680 /* No category. RFC4229 */
681 #define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style"
682 /* No category. RFC4229 */
683 #define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base"
684 /* Standard. RFC4918 */
685 #define MHD_HTTP_HEADER_DEPTH "Depth"
686 /* No category. RFC4229 */
687 #define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From"
688 /* Standard. RFC4918 */
689 #define MHD_HTTP_HEADER_DESTINATION "Destination"
690 /* No category. RFC4229 */
691 #define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID"
692 /* No category. RFC4229 */
693 #define MHD_HTTP_HEADER_DIGEST "Digest"
694 /* Standard. RFC8470 */
695 #define MHD_HTTP_HEADER_EARLY_DATA "Early-Data"
696 /* Experimental. RFC-ietf-httpbis-expect-ct-08 */
697 #define MHD_HTTP_HEADER_EXPECT_CT "Expect-CT"
698 /* No category. RFC4229 */
699 #define MHD_HTTP_HEADER_EXT "Ext"
700 /* Standard. RFC7239 */
701 #define MHD_HTTP_HEADER_FORWARDED "Forwarded"
702 /* No category. RFC4229 */
703 #define MHD_HTTP_HEADER_GETPROFILE "GetProfile"
704 /* Experimental. RFC7486, Section 6.1.1 */
705 #define MHD_HTTP_HEADER_HOBAREG "Hobareg"
706 /* Standard. RFC7540, Section 3.2.1 */
707 #define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings"
708 /* No category. RFC4229 */
709 #define MHD_HTTP_HEADER_IM "IM"
710 /* Standard. RFC4918 */
711 #define MHD_HTTP_HEADER_IF "If"
712 /* Standard. RFC6638 */
713 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
714 /* Standard. RFC8473 */
715 #define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID "Include-Referred-Token-Binding-ID"
716 /* No category. RFC4229 */
717 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
718 /* No category. RFC4229 */
719 #define MHD_HTTP_HEADER_LABEL "Label"
720 /* Standard. RFC8288 */
721 #define MHD_HTTP_HEADER_LINK "Link"
722 /* Standard. RFC4918 */
723 #define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token"
724 /* No category. RFC4229 */
725 #define MHD_HTTP_HEADER_MAN "Man"
726 /* Informational. RFC7089 */
727 #define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime"
728 /* No category. RFC4229 */
729 #define MHD_HTTP_HEADER_METER "Meter"
730 /* No category. RFC4229 */
731 #define MHD_HTTP_HEADER_NEGOTIATE "Negotiate"
732 /* No category. RFC4229 */
733 #define MHD_HTTP_HEADER_OPT "Opt"
734 /* Experimental. RFC8053, Section 3 */
735 #define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate"
736 /* Standard. RFC4229 */
737 #define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
738 /* Standard. RFC6454 */
739 #define MHD_HTTP_HEADER_ORIGIN "Origin"
740 /* Standard. RFC-ietf-core-object-security-16, Section 11.1 */
741 #define MHD_HTTP_HEADER_OSCORE "OSCORE"
742 /* Standard. RFC4918 */
743 #define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
744 /* No category. RFC4229 */
745 #define MHD_HTTP_HEADER_P3P "P3P"
746 /* No category. RFC4229 */
747 #define MHD_HTTP_HEADER_PEP "PEP"
748 /* No category. RFC4229 */
749 #define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label"
750 /* No category. RFC4229 */
751 #define MHD_HTTP_HEADER_PEP_INFO "Pep-Info"
752 /* Standard. RFC4229 */
753 #define MHD_HTTP_HEADER_POSITION "Position"
754 /* Standard. RFC7240 */
755 #define MHD_HTTP_HEADER_PREFER "Prefer"
756 /* Standard. RFC7240 */
757 #define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied"
758 /* No category. RFC4229 */
759 #define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject"
760 /* No category. RFC4229 */
761 #define MHD_HTTP_HEADER_PROTOCOL "Protocol"
762 /* No category. RFC4229 */
763 #define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info"
764 /* No category. RFC4229 */
765 #define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query"
766 /* No category. RFC4229 */
767 #define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request"
768 /* Standard. RFC7615, Section 4 */
769 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info"
770 /* No category. RFC4229 */
771 #define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features"
772 /* No category. RFC4229 */
773 #define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction"
774 /* No category. RFC4229 */
775 #define MHD_HTTP_HEADER_PUBLIC "Public"
776 /* Standard. RFC7469 */
777 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
778 /* Standard. RFC7469 */
779 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY "Public-Key-Pins-Report-Only"
780 /* No category. RFC4437 */
781 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
782 /* Standard. RFC8555, Section 6.5.1 */
783 #define MHD_HTTP_HEADER_REPLAY_NONCE "Replay-Nonce"
784 /* No category. RFC4229 */
785 #define MHD_HTTP_HEADER_SAFE "Safe"
786 /* Standard. RFC6638 */
787 #define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply"
788 /* Standard. RFC6638 */
789 #define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag"
790 /* Standard. RFC8473 */
791 #define MHD_HTTP_HEADER_SEC_TOKEN_BINDING "Sec-Token-Binding"
792 /* Standard. RFC6455 */
793 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept"
794 /* Standard. RFC6455 */
795 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions"
796 /* Standard. RFC6455 */
797 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key"
798 /* Standard. RFC6455 */
799 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol"
800 /* Standard. RFC6455 */
801 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version"
802 /* No category. RFC4229 */
803 #define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme"
804 /* Standard. RFC6265 */
805 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
806 /* Obsoleted. RFC2965; RFC6265 */
807 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
808 /* No category. RFC4229 */
809 #define MHD_HTTP_HEADER_SETPROFILE "SetProfile"
810 /* Standard. RFC5023 */
811 #define MHD_HTTP_HEADER_SLUG "SLUG"
812 /* No category. RFC4229 */
813 #define MHD_HTTP_HEADER_SOAPACTION "SoapAction"
814 /* No category. RFC4229 */
815 #define MHD_HTTP_HEADER_STATUS_URI "Status-URI"
816 /* Standard. RFC6797 */
817 #define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security"
818 /* Informational. RFC8594 */
819 #define MHD_HTTP_HEADER_SUNSET "Sunset"
820 /* No category. RFC4229 */
821 #define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability"
822 /* No category. RFC4229 */
823 #define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control"
824 /* No category. RFC4229 */
825 #define MHD_HTTP_HEADER_TCN "TCN"
826 /* Standard. RFC4918 */
827 #define MHD_HTTP_HEADER_TIMEOUT "Timeout"
828 /* Standard. RFC8030, Section 5.4 */
829 #define MHD_HTTP_HEADER_TOPIC "Topic"
830 /* Standard. RFC8030, Section 5.2 */
831 #define MHD_HTTP_HEADER_TTL "TTL"
832 /* Standard. RFC8030, Section 5.3 */
833 #define MHD_HTTP_HEADER_URGENCY "Urgency"
834 /* No category. RFC4229 */
835 #define MHD_HTTP_HEADER_URI "URI"
836 /* No category. RFC4229 */
837 #define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary"
838 /* No category. RFC4229 */
839 #define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest"
840 /* Standard. https://fetch.spec.whatwg.org/#x-content-type-options-header */
841 #define MHD_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS "X-Content-Type-Options"
842 /* Informational. RFC7034 */
843 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
844 
845 /* Some provisional headers. */
846 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin"
847  /* end of group headers */
848 
855 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
856 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
857  /* end of group versions */
859 
868 /* Main HTTP methods. */
869 /* Not safe. Not idempotent. RFC7231, Section 4.3.6. */
870 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
871 /* Not safe. Idempotent. RFC7231, Section 4.3.5. */
872 #define MHD_HTTP_METHOD_DELETE "DELETE"
873 /* Safe. Idempotent. RFC7231, Section 4.3.1. */
874 #define MHD_HTTP_METHOD_GET "GET"
875 /* Safe. Idempotent. RFC7231, Section 4.3.2. */
876 #define MHD_HTTP_METHOD_HEAD "HEAD"
877 /* Safe. Idempotent. RFC7231, Section 4.3.7. */
878 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
879 /* Not safe. Not idempotent. RFC7231, Section 4.3.3. */
880 #define MHD_HTTP_METHOD_POST "POST"
881 /* Not safe. Idempotent. RFC7231, Section 4.3.4. */
882 #define MHD_HTTP_METHOD_PUT "PUT"
883 /* Safe. Idempotent. RFC7231, Section 4.3.8. */
884 #define MHD_HTTP_METHOD_TRACE "TRACE"
885 
886 /* Additional HTTP methods. */
887 /* Not safe. Idempotent. RFC3744, Section 8.1. */
888 #define MHD_HTTP_METHOD_ACL "ACL"
889 /* Not safe. Idempotent. RFC3253, Section 12.6. */
890 #define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL"
891 /* Not safe. Idempotent. RFC5842, Section 4. */
892 #define MHD_HTTP_METHOD_BIND "BIND"
893 /* Not safe. Idempotent. RFC3253, Section 4.4, Section 9.4. */
894 #define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
895 /* Not safe. Idempotent. RFC3253, Section 4.3, Section 8.8. */
896 #define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
897 /* Not safe. Idempotent. RFC4918, Section 9.8. */
898 #define MHD_HTTP_METHOD_COPY "COPY"
899 /* Not safe. Idempotent. RFC3253, Section 8.2. */
900 #define MHD_HTTP_METHOD_LABEL "LABEL"
901 /* Not safe. Idempotent. RFC2068, Section 19.6.1.2. */
902 #define MHD_HTTP_METHOD_LINK "LINK"
903 /* Not safe. Not idempotent. RFC4918, Section 9.10. */
904 #define MHD_HTTP_METHOD_LOCK "LOCK"
905 /* Not safe. Idempotent. RFC3253, Section 11.2. */
906 #define MHD_HTTP_METHOD_MERGE "MERGE"
907 /* Not safe. Idempotent. RFC3253, Section 13.5. */
908 #define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
909 /* Not safe. Idempotent. RFC4791, Section 5.3.1; RFC8144, Section 2.3. */
910 #define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
911 /* Not safe. Idempotent. RFC4918, Section 9.3; RFC5689, Section 3; RFC8144, Section 2.3. */
912 #define MHD_HTTP_METHOD_MKCOL "MKCOL"
913 /* Not safe. Idempotent. RFC4437, Section 6. */
914 #define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
915 /* Not safe. Idempotent. RFC3253, Section 6.3. */
916 #define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
917 /* Not safe. Idempotent. RFC4918, Section 9.9. */
918 #define MHD_HTTP_METHOD_MOVE "MOVE"
919 /* Not safe. Idempotent. RFC3648, Section 7. */
920 #define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
921 /* Not safe. Not idempotent. RFC5789, Section 2. */
922 #define MHD_HTTP_METHOD_PATCH "PATCH"
923 /* Safe. Idempotent. RFC7540, Section 3.5. */
924 #define MHD_HTTP_METHOD_PRI "PRI"
925 /* Safe. Idempotent. RFC4918, Section 9.1; RFC8144, Section 2.1. */
926 #define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
927 /* Not safe. Idempotent. RFC4918, Section 9.2; RFC8144, Section 2.2. */
928 #define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
929 /* Not safe. Idempotent. RFC5842, Section 6. */
930 #define MHD_HTTP_METHOD_REBIND "REBIND"
931 /* Safe. Idempotent. RFC3253, Section 3.6; RFC8144, Section 2.1. */
932 #define MHD_HTTP_METHOD_REPORT "REPORT"
933 /* Safe. Idempotent. RFC5323, Section 2. */
934 #define MHD_HTTP_METHOD_SEARCH "SEARCH"
935 /* Not safe. Idempotent. RFC5842, Section 5. */
936 #define MHD_HTTP_METHOD_UNBIND "UNBIND"
937 /* Not safe. Idempotent. RFC3253, Section 4.5. */
938 #define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
939 /* Not safe. Idempotent. RFC2068, Section 19.6.1.3. */
940 #define MHD_HTTP_METHOD_UNLINK "UNLINK"
941 /* Not safe. Idempotent. RFC4918, Section 9.11. */
942 #define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
943 /* Not safe. Idempotent. RFC3253, Section 7.1. */
944 #define MHD_HTTP_METHOD_UPDATE "UPDATE"
945 /* Not safe. Idempotent. RFC4437, Section 7. */
946 #define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF"
947 /* Not safe. Idempotent. RFC3253, Section 3.5. */
948 #define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL"
949  /* end of group methods */
951 
957 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
958 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
959  /* end of group postenc */
961 
962 
967 struct MHD_Daemon;
968 
977 struct MHD_Connection;
978 
983 struct MHD_Response;
984 
989 struct MHD_PostProcessor;
990 
991 
1005 {
1010 
1017 
1023 
1028 
1031 #if 0
1032  /* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */
1033 #define MHD_USE_SSL \
1034  _MHD_DEPR_IN_MACRO("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
1035  MHD_USE_TLS
1036 #endif
1037 
1043 
1054 
1057 #if 0 /* Will be marked for real deprecation later. */
1058 #define MHD_USE_SELECT_INTERNALLY \
1059  _MHD_DEPR_IN_MACRO("Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \
1060  MHD_USE_INTERNAL_POLLING_THREAD
1061 #endif /* 0 */
1062 
1071 
1082 #if 0 /* Will be marked for real deprecation later. */
1083 #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") \
1085  32
1086 #endif /* 0 */
1087 
1097 
1103 
1106 #if 0 /* Will be marked for real deprecation later. */
1107 #define MHD_USE_POLL_INTERNALLY \
1108  _MHD_DEPR_IN_MACRO("Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \
1109  MHD_USE_POLL_INTERNAL_THREAD
1110 #endif /* 0 */
1111 
1119 
1122 #if 0 /* Will be marked for real deprecation later. */
1123 #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") \
1125  MHD_USE_SUPPRESS_DATE_NO_CLOCK
1126 #endif /* 0 */
1127 
1136 
1145 
1148 #if 0 /* Will be marked for real deprecation later. */
1149 #define MHD_USE_EPOLL_LINUX_ONLY \
1150  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
1151  MHD_USE_EPOLL
1152 #endif /* 0 */
1153 
1161 
1166 #if 0 /* Will be marked for real deprecation later. */
1167 #define MHD_USE_EPOLL_INTERNALLY \
1168  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1169  MHD_USE_EPOLL_INTERNAL_THREAD
1170 
1171 #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") \
1173  MHD_USE_EPOLL_INTERNAL_THREAD
1174 #endif /* 0 */
1175 
1188  MHD_USE_ITC = 1024,
1189 
1192 #if 0 /* Will be marked for real deprecation later. */
1193 #define MHD_USE_PIPE_FOR_SHUTDOWN \
1194  _MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
1195  MHD_USE_ITC
1196 #endif /* 0 */
1197 
1202 
1210 
1213 #if 0 /* Will be marked for real deprecation later. */
1214 #define MHD_USE_EPOLL_TURBO \
1215  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
1216  MHD_USE_TURBO
1217 #endif /* 0 */
1218 
1224 
1227 #if 0 /* Will be marked for real deprecation later. */
1228 #define MHD_USE_SUSPEND_RESUME \
1229  _MHD_DEPR_IN_MACRO("Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \
1230  MHD_ALLOW_SUSPEND_RESUME
1231 #endif /* 0 */
1232 
1239 
1246 
1258  MHD_USE_AUTO = 65536,
1259 
1267 
1273 
1279 
1280 };
1281 
1282 
1291 typedef void
1292 (*MHD_LogCallback)(void *cls,
1293  const char *fm,
1294  va_list ap);
1295 
1296 
1309 typedef int
1311  const struct MHD_Connection *connection,
1312  const char *username,
1313  void **psk,
1314  size_t *psk_size);
1315 
1322 {
1323 
1329 
1338 
1344 
1351 
1365 
1377 
1385 
1417 
1425 
1433 
1440 
1446 
1454 
1467 
1477 
1498 
1520 
1531 
1538 
1544 
1551 
1557 
1573 
1582 
1589 
1598 
1607 
1618 
1626 
1642 
1650 
1661 };
1662 
1663 
1668 {
1674 
1680  intptr_t value;
1681 
1686  void *ptr_value;
1687 
1688 };
1689 
1690 
1696 {
1697 
1703 #define MHD_RESPONSE_HEADER_KIND \
1704  _MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
1705  MHD_RESPONSE_HEADER_KIND
1706 
1711 
1717 
1727 
1732 
1737 };
1738 
1739 
1746 {
1747 
1753 
1761 
1769 
1776 
1786 
1794 
1795 };
1796 
1797 
1804 {
1805 
1811 
1817 
1818 };
1819 
1820 
1825 {
1826 
1830  int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
1831 
1835  int /* enum gnutls_protocol */ protocol;
1836 
1840  int /* MHD_YES or MHD_NO */ suspended;
1841 
1847  unsigned int connection_timeout;
1848 
1853 
1857  size_t header_size;
1858 
1862  void * /* gnutls_session_t */ tls_session;
1863 
1867  void * /* gnutls_x509_crt_t */ client_cert;
1868 
1872  struct sockaddr *client_addr;
1873 
1879 
1885 };
1886 
1887 
1894 {
1901 
1908 
1917 
1923 
1931 
1937 
1944 
1954 
1960 
1966 
1972 };
1973 
1974 
1980 {
1985 
1990 
1996 
2005 
2014 
2022 
2030 };
2031 
2032 
2043 typedef void
2044 (*MHD_PanicCallback) (void *cls,
2045  const char *file,
2046  unsigned int line,
2047  const char *reason);
2048 
2057 typedef int
2059  const struct sockaddr *addr,
2060  socklen_t addrlen);
2061 
2062 
2102 typedef int
2104  struct MHD_Connection *connection,
2105  const char *url,
2106  const char *method,
2107  const char *version,
2108  const char *upload_data,
2109  size_t *upload_data_size,
2110  void **con_cls);
2111 
2112 
2125 typedef void
2127  struct MHD_Connection *connection,
2128  void **con_cls,
2129  enum MHD_RequestTerminationCode toe);
2130 
2131 
2151 typedef void
2153  struct MHD_Connection *connection,
2154  void **socket_context,
2156 
2157 
2173 typedef int
2174 (*MHD_KeyValueIterator) (void *cls,
2175  enum MHD_ValueKind kind,
2176  const char *key,
2177  const char *value);
2178 
2179 
2198 typedef int
2200  enum MHD_ValueKind kind,
2201  const char *key,
2202  size_t key_size,
2203  const char *value,
2204  size_t value_size);
2205 
2206 
2251 typedef ssize_t
2253  uint64_t pos,
2254  char *buf,
2255  size_t max);
2256 
2257 
2267 typedef void
2269 
2270 
2290 typedef int
2291 (*MHD_PostDataIterator) (void *cls,
2292  enum MHD_ValueKind kind,
2293  const char *key,
2294  const char *filename,
2295  const char *content_type,
2296  const char *transfer_encoding,
2297  const char *data,
2298  uint64_t off,
2299  size_t size);
2300 
2301 /* **************** Daemon handling functions ***************** */
2302 
2324 _MHD_EXTERN struct MHD_Daemon *
2325 MHD_start_daemon_va (unsigned int flags,
2326  uint16_t port,
2328  MHD_AccessHandlerCallback dh, void *dh_cls,
2329  va_list ap);
2330 
2331 
2352 _MHD_EXTERN struct MHD_Daemon *
2353 MHD_start_daemon (unsigned int flags,
2354  uint16_t port,
2356  MHD_AccessHandlerCallback dh, void *dh_cls,
2357  ...);
2358 
2359 
2380 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
2381 
2382 
2389 _MHD_EXTERN void
2390 MHD_stop_daemon (struct MHD_Daemon *daemon);
2391 
2392 
2420 _MHD_EXTERN int
2421 MHD_add_connection (struct MHD_Daemon *daemon,
2422  MHD_socket client_socket,
2423  const struct sockaddr *addr,
2424  socklen_t addrlen);
2425 
2426 
2456 _MHD_EXTERN int
2457 MHD_get_fdset (struct MHD_Daemon *daemon,
2458  fd_set *read_fd_set,
2459  fd_set *write_fd_set,
2460  fd_set *except_fd_set,
2461  MHD_socket *max_fd);
2462 
2463 
2496 _MHD_EXTERN int
2497 MHD_get_fdset2 (struct MHD_Daemon *daemon,
2498  fd_set *read_fd_set,
2499  fd_set *write_fd_set,
2500  fd_set *except_fd_set,
2501  MHD_socket *max_fd,
2502  unsigned int fd_setsize);
2503 
2504 
2529 #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)
2531 
2532 
2551 _MHD_EXTERN int
2552 MHD_get_timeout (struct MHD_Daemon *daemon,
2553  MHD_UNSIGNED_LONG_LONG *timeout);
2554 
2555 
2576 _MHD_EXTERN int
2577 MHD_run (struct MHD_Daemon *daemon);
2578 
2579 
2602 _MHD_EXTERN int
2603 MHD_run_from_select (struct MHD_Daemon *daemon,
2604  const fd_set *read_fd_set,
2605  const fd_set *write_fd_set,
2606  const fd_set *except_fd_set);
2607 
2608 
2609 
2610 
2611 /* **************** Connection handling functions ***************** */
2612 
2625 _MHD_EXTERN int
2626 MHD_get_connection_values (struct MHD_Connection *connection,
2627  enum MHD_ValueKind kind,
2628  MHD_KeyValueIterator iterator,
2629  void *iterator_cls);
2630 
2631 
2644 _MHD_EXTERN int
2645 MHD_get_connection_values_n (struct MHD_Connection *connection,
2646  enum MHD_ValueKind kind,
2647  MHD_KeyValueIteratorN iterator,
2648  void *iterator_cls);
2649 
2650 
2677 _MHD_EXTERN int
2678 MHD_set_connection_value (struct MHD_Connection *connection,
2679  enum MHD_ValueKind kind,
2680  const char *key,
2681  const char *value);
2682 
2683 
2709 int
2710 MHD_set_connection_value_n (struct MHD_Connection *connection,
2711  enum MHD_ValueKind kind,
2712  const char *key,
2713  size_t key_size,
2714  const char *value,
2715  size_t value_size);
2716 
2717 
2734 _MHD_EXTERN void
2735 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
2736 
2737 
2747 _MHD_EXTERN size_t
2748 MHD_http_unescape (char *val);
2749 
2750 
2761 _MHD_EXTERN const char *
2762 MHD_lookup_connection_value (struct MHD_Connection *connection,
2763  enum MHD_ValueKind kind,
2764  const char *key);
2765 
2766 
2786 _MHD_EXTERN int
2787 MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2788  enum MHD_ValueKind kind,
2789  const char *key,
2790  size_t key_size,
2791  const char **value_ptr,
2792  size_t *value_size_ptr);
2793 
2794 
2806 _MHD_EXTERN int
2807 MHD_queue_response (struct MHD_Connection *connection,
2808  unsigned int status_code,
2809  struct MHD_Response *response);
2810 
2811 
2837 _MHD_EXTERN void
2838 MHD_suspend_connection (struct MHD_Connection *connection);
2839 
2840 
2855 _MHD_EXTERN void
2856 MHD_resume_connection (struct MHD_Connection *connection);
2857 
2858 
2859 /* **************** Response manipulation functions ***************** */
2860 
2861 
2866 {
2871 
2882 
2889 
2890 };
2891 
2892 
2897 {
2902 };
2903 
2904 
2913 _MHD_EXTERN int
2914 MHD_set_response_options (struct MHD_Response *response,
2915  enum MHD_ResponseFlags flags,
2916  ...);
2917 
2918 
2935 _MHD_EXTERN struct MHD_Response *
2936 MHD_create_response_from_callback (uint64_t size,
2937  size_t block_size,
2940 
2941 
2956 _MHD_DEPR_FUNC("MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
2957 _MHD_EXTERN struct MHD_Response *
2958 MHD_create_response_from_data (size_t size,
2959  void *data,
2960  int must_free,
2961  int must_copy);
2962 
2963 
2970 {
2971 
2979 
2987 
2996 
2997 };
2998 
2999 
3010 _MHD_EXTERN struct MHD_Response *
3011 MHD_create_response_from_buffer (size_t size,
3012  void *buffer,
3013  enum MHD_ResponseMemoryMode mode);
3014 
3015 
3016 
3017 
3028 _MHD_EXTERN struct MHD_Response *
3030  void *buffer,
3032 
3033 
3045 _MHD_EXTERN struct MHD_Response *
3046 MHD_create_response_from_fd (size_t size,
3047  int fd);
3048 
3049 
3063 _MHD_EXTERN struct MHD_Response *
3064 MHD_create_response_from_fd64 (uint64_t size,
3065  int fd);
3066 
3067 
3084 _MHD_DEPR_FUNC("Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3085 _MHD_EXTERN struct MHD_Response *
3087  int fd,
3088  off_t offset);
3089 
3090 #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()
3092  to minimize potential problems with different off_t sizes */
3093 #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()") \
3095  MHD_create_response_from_fd_at_offset64((size),(fd),(offset))
3096 #endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
3097 
3098 
3115 _MHD_EXTERN struct MHD_Response *
3117  int fd,
3118  uint64_t offset);
3119 
3120 
3128 {
3129 
3136 
3137 };
3138 
3139 
3145 struct MHD_UpgradeResponseHandle;
3146 
3147 
3160 _MHD_EXTERN int
3161 MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3162  enum MHD_UpgradeAction action,
3163  ...);
3164 
3165 
3213 typedef void
3214 (*MHD_UpgradeHandler)(void *cls,
3215  struct MHD_Connection *connection,
3216  void *con_cls,
3217  const char *extra_in,
3218  size_t extra_in_size,
3219  MHD_socket sock,
3220  struct MHD_UpgradeResponseHandle *urh);
3221 
3222 
3252 _MHD_EXTERN struct MHD_Response *
3254  void *upgrade_handler_cls);
3255 
3256 
3266 _MHD_EXTERN void
3267 MHD_destroy_response (struct MHD_Response *response);
3268 
3269 
3280 _MHD_EXTERN int
3281 MHD_add_response_header (struct MHD_Response *response,
3282  const char *header,
3283  const char *content);
3284 
3285 
3295 _MHD_EXTERN int
3296 MHD_add_response_footer (struct MHD_Response *response,
3297  const char *footer,
3298  const char *content);
3299 
3300 
3310 _MHD_EXTERN int
3311 MHD_del_response_header (struct MHD_Response *response,
3312  const char *header,
3313  const char *content);
3314 
3315 
3326 _MHD_EXTERN int
3327 MHD_get_response_headers (struct MHD_Response *response,
3328  MHD_KeyValueIterator iterator,
3329  void *iterator_cls);
3330 
3331 
3340 _MHD_EXTERN const char *
3341 MHD_get_response_header (struct MHD_Response *response,
3342  const char *key);
3343 
3344 
3345 /* ********************** PostProcessor functions ********************** */
3346 
3372 _MHD_EXTERN struct MHD_PostProcessor *
3373 MHD_create_post_processor (struct MHD_Connection *connection,
3374  size_t buffer_size,
3375  MHD_PostDataIterator iter, void *iter_cls);
3376 
3377 
3391 _MHD_EXTERN int
3392 MHD_post_process (struct MHD_PostProcessor *pp,
3393  const char *post_data, size_t post_data_len);
3394 
3395 
3406 _MHD_EXTERN int
3407 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
3408 
3409 
3410 /* ********************* Digest Authentication functions *************** */
3411 
3412 
3418 #define MHD_INVALID_NONCE -1
3419 
3420 
3429 _MHD_EXTERN char *
3430 MHD_digest_auth_get_username (struct MHD_Connection *connection);
3431 
3432 
3441 _MHD_EXTERN void
3442 MHD_free (void *ptr);
3443 
3444 
3449 
3454 
3459 
3464 
3465 };
3466 
3467 
3482 _MHD_EXTERN int
3483 MHD_digest_auth_check2 (struct MHD_Connection *connection,
3484  const char *realm,
3485  const char *username,
3486  const char *password,
3487  unsigned int nonce_timeout,
3488  enum MHD_DigestAuthAlgorithm algo);
3489 
3490 
3509 _MHD_EXTERN int
3510 MHD_digest_auth_check (struct MHD_Connection *connection,
3511  const char *realm,
3512  const char *username,
3513  const char *password,
3514  unsigned int nonce_timeout);
3515 
3516 
3534 _MHD_EXTERN int
3535 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3536  const char *realm,
3537  const char *username,
3538  const uint8_t *digest,
3539  size_t digest_size,
3540  unsigned int nonce_timeout,
3541  enum MHD_DigestAuthAlgorithm algo);
3542 
3543 
3562 _MHD_EXTERN int
3563 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3564  const char *realm,
3565  const char *username,
3566  const uint8_t digest[MHD_MD5_DIGEST_SIZE],
3567  unsigned int nonce_timeout);
3568 
3569 
3585 _MHD_EXTERN int
3586 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3587  const char *realm,
3588  const char *opaque,
3589  struct MHD_Response *response,
3590  int signal_stale,
3591  enum MHD_DigestAuthAlgorithm algo);
3592 
3593 
3611 _MHD_EXTERN int
3612 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3613  const char *realm,
3614  const char *opaque,
3615  struct MHD_Response *response,
3616  int signal_stale);
3617 
3618 
3628 _MHD_EXTERN char *
3630  char** password);
3631 
3632 
3645 _MHD_EXTERN int
3647  const char *realm,
3648  struct MHD_Response *response);
3649 
3650 /* ********************** generic query functions ********************** */
3651 
3652 
3663 _MHD_EXTERN const union MHD_ConnectionInfo *
3664 MHD_get_connection_info (struct MHD_Connection *connection,
3665  enum MHD_ConnectionInfoType info_type,
3666  ...);
3667 
3668 
3674 {
3675 
3684 
3685 };
3686 
3687 
3697 _MHD_EXTERN int
3698 MHD_set_connection_option (struct MHD_Connection *connection,
3699  enum MHD_CONNECTION_OPTION option,
3700  ...);
3701 
3702 
3707 {
3712  size_t key_size;
3713 
3719 
3724 
3728  uint16_t port;
3729 
3734 
3738  unsigned int num_connections;
3739 
3747 };
3748 
3749 
3761 _MHD_EXTERN const union MHD_DaemonInfo *
3762 MHD_get_daemon_info (struct MHD_Daemon *daemon,
3763  enum MHD_DaemonInfoType info_type,
3764  ...);
3765 
3766 
3773 _MHD_EXTERN const char*
3774 MHD_get_version (void);
3775 
3776 
3782 {
3788 
3798 
3804 
3810 
3818 
3824 
3831 
3838 
3844 
3851 
3858 
3866 
3874 
3881 
3891 
3897 
3904 
3917 
3923 
3930 
3937 
3942 
3948 };
3949 
3950 
3962 _MHD_EXTERN int
3963 MHD_is_feature_supported (enum MHD_FEATURE feature);
3964 
3965 
3966 #if 0 /* keep Emacsens' auto-indent happy */
3967 {
3968 #endif
3969 #ifdef __cplusplus
3970 }
3971 #endif
3972 
3973 #endif
#define _MHD_DEPR_FUNC(msg)
Definition: microhttpd.h:270
int(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: microhttpd.h:2174
_MHD_EXTERN int MHD_get_connection_values_n(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIteratorN iterator, void *iterator_cls)
Definition: connection.c:730
_MHD_EXTERN struct MHD_Daemon * MHD_start_daemon_va(unsigned int flags, uint16_t port, MHD_AcceptPolicyCallback apc, void *apc_cls, MHD_AccessHandlerCallback dh, void *dh_cls, va_list ap)
Definition: daemon.c:5597
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_callback(uint64_t size, size_t block_size, MHD_ContentReaderCallback crc, void *crc_cls, MHD_ContentReaderFreeCallback crfc)
Definition: response.c:373
_MHD_EXTERN const char * MHD_get_version(void)
Definition: version.c:35
size_t mac_key_size
Definition: microhttpd.h:3718
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
Definition: connection.c:920
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
Definition: microhttpd.h:1310
MHD_socket listen_fd
Definition: microhttpd.h:3723
void * data
Definition: microhttpd.h:2959
_MHD_EXTERN int MHD_add_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:133
void int int must_copy
Definition: microhttpd.h:2959
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1603
_MHD_EXTERN int MHD_get_timeout(struct MHD_Daemon *daemon, MHD_UNSIGNED_LONG_LONG *timeout)
Definition: daemon.c:3384
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2268
char * version
Definition: internal.h:719
_MHD_EXTERN int MHD_add_connection(struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen)
Definition: daemon.c:3083
int(* MHD_PostDataIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size)
Definition: microhttpd.h:2291
_MHD_EXTERN int MHD_queue_basic_auth_fail_response(struct MHD_Connection *connection, const char *realm, struct MHD_Response *response)
Definition: basicauth.c:123
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd64(uint64_t size, int fd)
Definition: response.c:652
int MHD_set_connection_value_n(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, size_t key_size, const char *value, size_t value_size)
Definition: connection.c:844
MHD_RequestTerminationCode
Definition: microhttpd.h:1745
_MHD_EXTERN int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
MHD_socket connect_fd
Definition: microhttpd.h:1852
int MHD_socket
Definition: microhttpd.h:187
_MHD_EXTERN int MHD_digest_auth_check(struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout)
Definition: digestauth.c:1157
_MHD_EXTERN struct MHD_Daemon * MHD_start_daemon(unsigned int flags, uint16_t port, MHD_AcceptPolicyCallback apc, void *apc_cls, MHD_AccessHandlerCallback dh, void *dh_cls,...)
Definition: daemon.c:4758
intptr_t value
Definition: microhttpd.h:1680
MHD_ConnectionNotificationCode
Definition: microhttpd.h:1803
_MHD_EXTERN int MHD_queue_auth_fail_response2(struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale, enum MHD_DigestAuthAlgorithm algo)
Definition: digestauth.c:1342
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
Definition: panic.c:56
#define MHD_UNSIGNED_LONG_LONG
Definition: microhttpd.h:283
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:2044
_MHD_EXTERN struct MHD_PostProcessor * MHD_create_post_processor(struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iter, void *iter_cls)
void(* MHD_LogCallback)(void *cls, const char *fm, va_list ap)
Definition: microhttpd.h:1292
MHD_ResponseOptions
Definition: microhttpd.h:2896
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:4180
void * socket_context
Definition: internal.h:691
#define MHD_MD5_DIGEST_SIZE
Definition: microhttpd.h:305
MHD_CONNECTION_OPTION
Definition: microhttpd.h:3673
_MHD_EXTERN int MHD_digest_auth_check_digest(struct MHD_Connection *connection, const char *realm, const char *username, const uint8_t digest[MHD_MD5_DIGEST_SIZE], unsigned int nonce_timeout)
Definition: digestauth.c:1310
_MHD_EXTERN char * MHD_basic_auth_get_username_password(struct MHD_Connection *connection, char **password)
Definition: basicauth.c:47
void * crc_cls
Definition: internal.h:1591
int fd
Definition: microhttpd.h:3087
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:6700
const char * url
Definition: internal.h:713
_MHD_EXTERN int MHD_queue_auth_fail_response(struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale)
Definition: digestauth.c:1458
_MHD_EXTERN int MHD_digest_auth_check2(struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo)
Definition: digestauth.c:1233
_MHD_EXTERN int MHD_add_response_footer(struct MHD_Response *response, const char *footer, const char *content)
Definition: response.c:175
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd_at_offset64(uint64_t size, int fd, uint64_t offset)
Definition: response.c:587
char * method
Definition: internal.h:707
#define _MHD_EXTERN
Definition: microhttpd.h:177
_MHD_EXTERN int MHD_run_from_select(struct MHD_Daemon *daemon, const fd_set *read_fd_set, const fd_set *write_fd_set, const fd_set *except_fd_set)
Definition: daemon.c:3578
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2252
MHD_DigestAuthAlgorithm
Definition: microhttpd.h:3448
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
Definition: digestauth.c:626
_MHD_EXTERN int MHD_digest_auth_check_digest2(struct MHD_Connection *connection, const char *realm, const char *username, const uint8_t *digest, size_t digest_size, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo)
Definition: digestauth.c:1270
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
Definition: response.c:1162
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
Definition: daemon.c:2867
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:4237
void int must_free
Definition: microhttpd.h:2959
uint16_t port
Definition: internal.h:1605
struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
Definition: response.c:676
MHD_ValueKind
Definition: microhttpd.h:1695
struct MHD_Daemon * daemon
Definition: microhttpd.h:1878
_MHD_EXTERN int MHD_post_process(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
#define MHD_create_response_from_fd_at_offset(size, fd, offset)
Definition: microhttpd.h:3093
MHD_FEATURE
Definition: microhttpd.h:3781
MHD_ConnectionInfoType
Definition: microhttpd.h:1893
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
Definition: response.c:629
_MHD_EXTERN int MHD_upgrade_action(struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action,...)
int off_t offset
Definition: microhttpd.h:3087
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:4303
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
Definition: response.c:734
unsigned int connection_timeout
Definition: microhttpd.h:1847
MHD_AcceptPolicyCallback apc
Definition: internal.h:1367
uint16_t port
Definition: microhttpd.h:3728
int(* MHD_AccessHandlerCallback)(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls)
Definition: microhttpd.h:2103
_MHD_EXTERN struct MHD_Response * MHD_create_response_for_upgrade(MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls)
void * ptr_value
Definition: microhttpd.h:1686
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:2126
void(* MHD_UpgradeHandler)(void *cls, struct MHD_Connection *connection, void *con_cls, const char *extra_in, size_t extra_in_size, MHD_socket sock, struct MHD_UpgradeResponseHandle *urh)
Definition: microhttpd.h:3214
_MHD_EXTERN void MHD_free(void *ptr)
Definition: memorypool.c:89
_MHD_EXTERN int MHD_set_response_options(struct MHD_Response *response, enum MHD_ResponseFlags flags,...)
Definition: response.c:413
_MHD_EXTERN int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: connection.c:691
_MHD_EXTERN int MHD_run(struct MHD_Daemon *daemon)
Definition: daemon.c:4604
MHD_OPTION
MHD options.
Definition: microhttpd.h:1321
enum MHD_FLAG flags
Definition: microhttpd.h:3746
void * apc_cls
Definition: internal.h:1372
#define MHD_get_fdset(daemon, read_fd_set, write_fd_set, except_fd_set, max_fd)
Definition: microhttpd.h:2529
MHD_ContentReaderCallback crc
Definition: internal.h:1597
MHD_UpgradeAction
Definition: microhttpd.h:3127
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer_with_free_callback(size_t size, void *buffer, MHD_ContentReaderFreeCallback crfc)
Definition: response.c:756
MHD_DaemonInfoType
Definition: microhttpd.h:1979
_MHD_EXTERN int MHD_lookup_connection_value_n(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, size_t key_size, const char **value_ptr, size_t *value_size_ptr)
Definition: connection.c:957
_MHD_EXTERN int MHD_is_feature_supported(enum MHD_FEATURE feature)
Definition: daemon.c:6979
struct sockaddr * client_addr
Definition: microhttpd.h:1872
_MHD_EXTERN int MHD_del_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:196
#define _MHD_DEPR_MACRO(msg)
Definition: microhttpd.h:241
_MHD_EXTERN int MHD_get_fdset2(struct MHD_Daemon *daemon, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, MHD_socket *max_fd, unsigned int fd_setsize)
Definition: daemon.c:1120
MHD_ResponseFlags
Definition: microhttpd.h:2865
_MHD_EXTERN const char * MHD_get_response_header(struct MHD_Response *response, const char *key)
Definition: response.c:282
_MHD_EXTERN MHD_socket MHD_quiesce_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:4803
unsigned int num_connections
Definition: microhttpd.h:3738
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2058
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2152
_MHD_EXTERN const union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
Definition: daemon.c:6864
_MHD_EXTERN size_t MHD_http_unescape(char *val)
Definition: internal.c:138
_MHD_EXTERN const char * MHD_get_reason_phrase_for(unsigned int code)
enum MHD_OPTION option
Definition: microhttpd.h:1673
_MHD_EXTERN int MHD_set_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: connection.c:891
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1004
#define MHD_RESPONSE_HEADER_KIND
Definition: microhttpd.h:1703
_MHD_EXTERN int MHD_get_response_headers(struct MHD_Response *response, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: response.c:250
MHD_ResponseMemoryMode
Definition: microhttpd.h:2969
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:2896
int(* MHD_KeyValueIteratorN)(void *cls, enum MHD_ValueKind kind, const char *key, size_t key_size, const char *value, size_t value_size)
Definition: microhttpd.h:2199