GNU libmicrohttpd  0.9.71
microhttpd.h
Go to the documentation of this file.
1 /*
2  This file is part of libmicrohttpd
3  Copyright (C) 2006--2020 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 0x00097002
136 
141 {
145  MHD_NO = 0,
146 
151 
152 };
153 
154 
158 #define MHD_INVALID_NONCE -1
159 
164 #ifdef UINT64_MAX
165 #define MHD_SIZE_UNKNOWN UINT64_MAX
166 #else
167 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
168 #endif
169 
170 #ifdef SIZE_MAX
171 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
172 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
173 #else
174 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
175 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
176 #endif
177 
178 #ifndef _MHD_EXTERN
179 #if defined(_WIN32) && defined(MHD_W32LIB)
180 #define _MHD_EXTERN extern
181 #elif defined (_WIN32) && defined(MHD_W32DLL)
182 /* Define MHD_W32DLL when using MHD as W32 .DLL to speed up linker a little */
183 #define _MHD_EXTERN __declspec(dllimport)
184 #else
185 #define _MHD_EXTERN extern
186 #endif
187 #endif
188 
189 #ifndef MHD_SOCKET_DEFINED
190 
193 #if ! defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
194 #define MHD_POSIX_SOCKETS 1
195 typedef int MHD_socket;
196 #define MHD_INVALID_SOCKET (-1)
197 #else /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
198 #define MHD_WINSOCK_SOCKETS 1
199 #include <winsock2.h>
200 typedef SOCKET MHD_socket;
201 #define MHD_INVALID_SOCKET (INVALID_SOCKET)
202 #endif /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
203 #define MHD_SOCKET_DEFINED 1
204 #endif /* MHD_SOCKET_DEFINED */
205 
209 #ifdef MHD_NO_DEPRECATION
210 #define _MHD_DEPR_MACRO(msg)
211 #define _MHD_NO_DEPR_IN_MACRO 1
212 #define _MHD_DEPR_IN_MACRO(msg)
213 #define _MHD_NO_DEPR_FUNC 1
214 #define _MHD_DEPR_FUNC(msg)
215 #endif /* MHD_NO_DEPRECATION */
216 
217 #ifndef _MHD_DEPR_MACRO
218 #if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1500
219 /* VS 2008 or later */
220 /* Stringify macros */
221 #define _MHD_INSTRMACRO(a) #a
222 #define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a)
223 /* deprecation message */
224 #define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \
225  __LINE__) "): warning: " msg))
226 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
227 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
228 /* clang or GCC since 3.0 */
229 #define _MHD_GCC_PRAG(x) _Pragma (#x)
230 #if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \
231  (! defined(__apple_build_version__) && \
232  (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \
233  3))))) || \
234  __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8)
235 /* clang >= 3.3 (or XCode's clang >= 5.0) or
236  GCC >= 4.8 */
237 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg)
238 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
239 #else /* older clang or GCC */
240 /* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
241 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg)
242 #if (defined(__clang__) && (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == \
243  2 && __clang_minor__ >= \
244  9))) /* FIXME: clang >= 2.9, earlier versions not tested */
245 /* clang handles inline pragmas better than GCC */
246 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
247 #endif /* clang >= 2.9 */
248 #endif /* older clang or GCC */
249 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
250 #endif /* clang || GCC >= 3.0 */
251 #endif /* !_MHD_DEPR_MACRO */
252 
253 #ifndef _MHD_DEPR_MACRO
254 #define _MHD_DEPR_MACRO(msg)
255 #endif /* !_MHD_DEPR_MACRO */
256 
257 #ifndef _MHD_DEPR_IN_MACRO
258 #define _MHD_NO_DEPR_IN_MACRO 1
259 #define _MHD_DEPR_IN_MACRO(msg)
260 #endif /* !_MHD_DEPR_IN_MACRO */
261 
262 #ifndef _MHD_DEPR_FUNC
263 #if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400
264 /* VS 2005 or later */
265 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg))
266 #elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310
267 /* VS .NET 2003 deprecation do not support custom messages */
268 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
269 #elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \
270  (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \
271  9))) /* FIXME: earlier versions not tested */
272 /* GCC >= 5.0 or clang >= 2.9 */
273 #define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg)))
274 #elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \
275  __GNUC_MINOR__ + 0 >= 1)
276 /* 3.1 <= GCC < 5.0 or clang < 2.9 */
277 /* old GCC-style deprecation do not support custom messages */
278 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
279 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
280 #endif /* clang < 2.9 || GCC >= 3.1 */
281 #endif /* !_MHD_DEPR_FUNC */
282 
283 #ifndef _MHD_DEPR_FUNC
284 #define _MHD_NO_DEPR_FUNC 1
285 #define _MHD_DEPR_FUNC(msg)
286 #endif /* !_MHD_DEPR_FUNC */
287 
293 #ifndef MHD_LONG_LONG
294 
297 #define MHD_LONG_LONG long long
298 #define MHD_UNSIGNED_LONG_LONG unsigned long long
299 #else /* MHD_LONG_LONG */
301  "Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
302 #endif
303 
307 #ifndef MHD_LONG_LONG_PRINTF
308 
311 #define MHD_LONG_LONG_PRINTF "ll"
312 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
313 #else /* MHD_LONG_LONG_PRINTF */
315  "Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
316 #endif
317 
318 
322 #define MHD_MD5_DIGEST_SIZE 16
323 
324 
333 /* 100 "Continue". RFC7231, Section 6.2.1. */
334 #define MHD_HTTP_CONTINUE 100
335 /* 101 "Switching Protocols". RFC7231, Section 6.2.2. */
336 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
337 /* 102 "Processing". RFC2518. */
338 #define MHD_HTTP_PROCESSING 102
339 /* 103 "Early Hints". RFC8297. */
340 #define MHD_HTTP_EARLY_HINTS 103
341 
342 /* 200 "OK". RFC7231, Section 6.3.1. */
343 #define MHD_HTTP_OK 200
344 /* 201 "Created". RFC7231, Section 6.3.2. */
345 #define MHD_HTTP_CREATED 201
346 /* 202 "Accepted". RFC7231, Section 6.3.3. */
347 #define MHD_HTTP_ACCEPTED 202
348 /* 203 "Non-Authoritative Information". RFC7231, Section 6.3.4. */
349 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
350 /* 204 "No Content". RFC7231, Section 6.3.5. */
351 #define MHD_HTTP_NO_CONTENT 204
352 /* 205 "Reset Content". RFC7231, Section 6.3.6. */
353 #define MHD_HTTP_RESET_CONTENT 205
354 /* 206 "Partial Content". RFC7233, Section 4.1. */
355 #define MHD_HTTP_PARTIAL_CONTENT 206
356 /* 207 "Multi-Status". RFC4918. */
357 #define MHD_HTTP_MULTI_STATUS 207
358 /* 208 "Already Reported". RFC5842. */
359 #define MHD_HTTP_ALREADY_REPORTED 208
360 
361 /* 226 "IM Used". RFC3229. */
362 #define MHD_HTTP_IM_USED 226
363 
364 /* 300 "Multiple Choices". RFC7231, Section 6.4.1. */
365 #define MHD_HTTP_MULTIPLE_CHOICES 300
366 /* 301 "Moved Permanently". RFC7231, Section 6.4.2. */
367 #define MHD_HTTP_MOVED_PERMANENTLY 301
368 /* 302 "Found". RFC7231, Section 6.4.3. */
369 #define MHD_HTTP_FOUND 302
370 /* 303 "See Other". RFC7231, Section 6.4.4. */
371 #define MHD_HTTP_SEE_OTHER 303
372 /* 304 "Not Modified". RFC7232, Section 4.1. */
373 #define MHD_HTTP_NOT_MODIFIED 304
374 /* 305 "Use Proxy". RFC7231, Section 6.4.5. */
375 #define MHD_HTTP_USE_PROXY 305
376 /* 306 "Switch Proxy". Not used! RFC7231, Section 6.4.6. */
377 #define MHD_HTTP_SWITCH_PROXY 306
378 /* 307 "Temporary Redirect". RFC7231, Section 6.4.7. */
379 #define MHD_HTTP_TEMPORARY_REDIRECT 307
380 /* 308 "Permanent Redirect". RFC7538. */
381 #define MHD_HTTP_PERMANENT_REDIRECT 308
382 
383 /* 400 "Bad Request". RFC7231, Section 6.5.1. */
384 #define MHD_HTTP_BAD_REQUEST 400
385 /* 401 "Unauthorized". RFC7235, Section 3.1. */
386 #define MHD_HTTP_UNAUTHORIZED 401
387 /* 402 "Payment Required". RFC7231, Section 6.5.2. */
388 #define MHD_HTTP_PAYMENT_REQUIRED 402
389 /* 403 "Forbidden". RFC7231, Section 6.5.3. */
390 #define MHD_HTTP_FORBIDDEN 403
391 /* 404 "Not Found". RFC7231, Section 6.5.4. */
392 #define MHD_HTTP_NOT_FOUND 404
393 /* 405 "Method Not Allowed". RFC7231, Section 6.5.5. */
394 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
395 /* 406 "Not Acceptable". RFC7231, Section 6.5.6. */
396 #define MHD_HTTP_NOT_ACCEPTABLE 406
397 /* 407 "Proxy Authentication Required". RFC7235, Section 3.2. */
398 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
399 /* 408 "Request Timeout". RFC7231, Section 6.5.7. */
400 #define MHD_HTTP_REQUEST_TIMEOUT 408
401 /* 409 "Conflict". RFC7231, Section 6.5.8. */
402 #define MHD_HTTP_CONFLICT 409
403 /* 410 "Gone". RFC7231, Section 6.5.9. */
404 #define MHD_HTTP_GONE 410
405 /* 411 "Length Required". RFC7231, Section 6.5.10. */
406 #define MHD_HTTP_LENGTH_REQUIRED 411
407 /* 412 "Precondition Failed". RFC7232, Section 4.2; RFC8144, Section 3.2. */
408 #define MHD_HTTP_PRECONDITION_FAILED 412
409 /* 413 "Payload Too Large". RFC7231, Section 6.5.11. */
410 #define MHD_HTTP_PAYLOAD_TOO_LARGE 413
411 /* 414 "URI Too Long". RFC7231, Section 6.5.12. */
412 #define MHD_HTTP_URI_TOO_LONG 414
413 /* 415 "Unsupported Media Type". RFC7231, Section 6.5.13; RFC7694, Section 3. */
414 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
415 /* 416 "Range Not Satisfiable". RFC7233, Section 4.4. */
416 #define MHD_HTTP_RANGE_NOT_SATISFIABLE 416
417 /* 417 "Expectation Failed". RFC7231, Section 6.5.14. */
418 #define MHD_HTTP_EXPECTATION_FAILED 417
419 
420 /* 421 "Misdirected Request". RFC7540, Section 9.1.2. */
421 #define MHD_HTTP_MISDIRECTED_REQUEST 421
422 /* 422 "Unprocessable Entity". RFC4918. */
423 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
424 /* 423 "Locked". RFC4918. */
425 #define MHD_HTTP_LOCKED 423
426 /* 424 "Failed Dependency". RFC4918. */
427 #define MHD_HTTP_FAILED_DEPENDENCY 424
428 /* 425 "Too Early". RFC8470. */
429 #define MHD_HTTP_TOO_EARLY 425
430 /* 426 "Upgrade Required". RFC7231, Section 6.5.15. */
431 #define MHD_HTTP_UPGRADE_REQUIRED 426
432 
433 /* 428 "Precondition Required". RFC6585. */
434 #define MHD_HTTP_PRECONDITION_REQUIRED 428
435 /* 429 "Too Many Requests". RFC6585. */
436 #define MHD_HTTP_TOO_MANY_REQUESTS 429
437 
438 /* 431 "Request Header Fields Too Large". RFC6585. */
439 #define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
440 
441 /* 451 "Unavailable For Legal Reasons". RFC7725. */
442 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
443 
444 /* 500 "Internal Server Error". RFC7231, Section 6.6.1. */
445 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
446 /* 501 "Not Implemented". RFC7231, Section 6.6.2. */
447 #define MHD_HTTP_NOT_IMPLEMENTED 501
448 /* 502 "Bad Gateway". RFC7231, Section 6.6.3. */
449 #define MHD_HTTP_BAD_GATEWAY 502
450 /* 503 "Service Unavailable". RFC7231, Section 6.6.4. */
451 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
452 /* 504 "Gateway Timeout". RFC7231, Section 6.6.5. */
453 #define MHD_HTTP_GATEWAY_TIMEOUT 504
454 /* 505 "HTTP Version Not Supported". RFC7231, Section 6.6.6. */
455 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
456 /* 506 "Variant Also Negotiates". RFC2295. */
457 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
458 /* 507 "Insufficient Storage". RFC4918. */
459 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
460 /* 508 "Loop Detected". RFC5842. */
461 #define MHD_HTTP_LOOP_DETECTED 508
462 
463 /* 510 "Not Extended". RFC2774. */
464 #define MHD_HTTP_NOT_EXTENDED 510
465 /* 511 "Network Authentication Required". RFC6585. */
466 #define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
467 
468 
469 /* Not registered non-standard codes */
470 /* 449 "Reply With". MS IIS extension. */
471 #define MHD_HTTP_RETRY_WITH 449
472 
473 /* 450 "Blocked by Windows Parental Controls". MS extension. */
474 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
475 
476 /* 509 "Bandwidth Limit Exceeded". Apache extension. */
477 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
478 
479 
480 /* Deprecated codes */
482 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
483  _MHD_DEPR_IN_MACRO ( \
484  "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") \
485  406
486 
488 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
489  _MHD_DEPR_IN_MACRO ( \
490  "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") \
491  413
492 
494 #define MHD_HTTP_REQUEST_URI_TOO_LONG \
495  _MHD_DEPR_IN_MACRO ( \
496  "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") \
497  414
498 
500 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
501  _MHD_DEPR_IN_MACRO ( \
502  "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") \
503  416
504 
506 #define MHD_HTTP_UNORDERED_COLLECTION \
507  _MHD_DEPR_IN_MACRO ( \
508  "Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") \
509  425
510 
512 #define MHD_HTTP_NO_RESPONSE \
513  _MHD_DEPR_IN_MACRO ( \
514  "Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for logs only") \
515  444
516 
517  /* end of group httpcode */
519 
526 _MHD_EXTERN const char *
527 MHD_get_reason_phrase_for (unsigned int code);
528 
529 
536 #define MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31))
537 
546 /* Main HTTP headers. */
547 /* Standard. RFC7231, Section 5.3.2 */
548 #define MHD_HTTP_HEADER_ACCEPT "Accept"
549 /* Standard. RFC7231, Section 5.3.3 */
550 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
551 /* Standard. RFC7231, Section 5.3.4; RFC7694, Section 3 */
552 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
553 /* Standard. RFC7231, Section 5.3.5 */
554 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
555 /* Standard. RFC7233, Section 2.3 */
556 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
557 /* Standard. RFC7234, Section 5.1 */
558 #define MHD_HTTP_HEADER_AGE "Age"
559 /* Standard. RFC7231, Section 7.4.1 */
560 #define MHD_HTTP_HEADER_ALLOW "Allow"
561 /* Standard. RFC7235, Section 4.2 */
562 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
563 /* Standard. RFC7234, Section 5.2 */
564 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
565 /* Reserved. RFC7230, Section 8.1 */
566 #define MHD_HTTP_HEADER_CLOSE "Close"
567 /* Standard. RFC7230, Section 6.1 */
568 #define MHD_HTTP_HEADER_CONNECTION "Connection"
569 /* Standard. RFC7231, Section 3.1.2.2 */
570 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
571 /* Standard. RFC7231, Section 3.1.3.2 */
572 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
573 /* Standard. RFC7230, Section 3.3.2 */
574 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
575 /* Standard. RFC7231, Section 3.1.4.2 */
576 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
577 /* Standard. RFC7233, Section 4.2 */
578 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
579 /* Standard. RFC7231, Section 3.1.1.5 */
580 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
581 /* Standard. RFC7231, Section 7.1.1.2 */
582 #define MHD_HTTP_HEADER_DATE "Date"
583 /* Standard. RFC7232, Section 2.3 */
584 #define MHD_HTTP_HEADER_ETAG "ETag"
585 /* Standard. RFC7231, Section 5.1.1 */
586 #define MHD_HTTP_HEADER_EXPECT "Expect"
587 /* Standard. RFC7234, Section 5.3 */
588 #define MHD_HTTP_HEADER_EXPIRES "Expires"
589 /* Standard. RFC7231, Section 5.5.1 */
590 #define MHD_HTTP_HEADER_FROM "From"
591 /* Standard. RFC7230, Section 5.4 */
592 #define MHD_HTTP_HEADER_HOST "Host"
593 /* Standard. RFC7232, Section 3.1 */
594 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
595 /* Standard. RFC7232, Section 3.3 */
596 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
597 /* Standard. RFC7232, Section 3.2 */
598 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
599 /* Standard. RFC7233, Section 3.2 */
600 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
601 /* Standard. RFC7232, Section 3.4 */
602 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
603 /* Standard. RFC7232, Section 2.2 */
604 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
605 /* Standard. RFC7231, Section 7.1.2 */
606 #define MHD_HTTP_HEADER_LOCATION "Location"
607 /* Standard. RFC7231, Section 5.1.2 */
608 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
609 /* Standard. RFC7231, Appendix A.1 */
610 #define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version"
611 /* Standard. RFC7234, Section 5.4 */
612 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
613 /* Standard. RFC7235, Section 4.3 */
614 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
615 /* Standard. RFC7235, Section 4.4 */
616 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
617 /* Standard. RFC7233, Section 3.1 */
618 #define MHD_HTTP_HEADER_RANGE "Range"
619 /* Standard. RFC7231, Section 5.5.2 */
620 #define MHD_HTTP_HEADER_REFERER "Referer"
621 /* Standard. RFC7231, Section 7.1.3 */
622 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
623 /* Standard. RFC7231, Section 7.4.2 */
624 #define MHD_HTTP_HEADER_SERVER "Server"
625 /* Standard. RFC7230, Section 4.3 */
626 #define MHD_HTTP_HEADER_TE "TE"
627 /* Standard. RFC7230, Section 4.4 */
628 #define MHD_HTTP_HEADER_TRAILER "Trailer"
629 /* Standard. RFC7230, Section 3.3.1 */
630 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
631 /* Standard. RFC7230, Section 6.7 */
632 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
633 /* Standard. RFC7231, Section 5.5.3 */
634 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
635 /* Standard. RFC7231, Section 7.1.4 */
636 #define MHD_HTTP_HEADER_VARY "Vary"
637 /* Standard. RFC7230, Section 5.7.1 */
638 #define MHD_HTTP_HEADER_VIA "Via"
639 /* Standard. RFC7235, Section 4.1 */
640 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
641 /* Standard. RFC7234, Section 5.5 */
642 #define MHD_HTTP_HEADER_WARNING "Warning"
643 
644 /* Additional HTTP headers. */
645 /* No category. RFC4229 */
646 #define MHD_HTTP_HEADER_A_IM "A-IM"
647 /* No category. RFC4229 */
648 #define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions"
649 /* Informational. RFC7089 */
650 #define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime"
651 /* No category. RFC4229 */
652 #define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features"
653 /* No category. RFC5789 */
654 #define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch"
655 /* Standard. https://www.w3.org/TR/ldp/ */
656 #define MHD_HTTP_HEADER_ACCEPT_POST "Accept-Post"
657 /* Standard. RFC7639, Section 2 */
658 #define MHD_HTTP_HEADER_ALPN "ALPN"
659 /* Standard. RFC7838 */
660 #define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc"
661 /* Standard. RFC7838 */
662 #define MHD_HTTP_HEADER_ALT_USED "Alt-Used"
663 /* No category. RFC4229 */
664 #define MHD_HTTP_HEADER_ALTERNATES "Alternates"
665 /* No category. RFC4437 */
666 #define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref"
667 /* Experimental. RFC8053, Section 4 */
668 #define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control"
669 /* Standard. RFC7615, Section 3 */
670 #define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info"
671 /* No category. RFC4229 */
672 #define MHD_HTTP_HEADER_C_EXT "C-Ext"
673 /* No category. RFC4229 */
674 #define MHD_HTTP_HEADER_C_MAN "C-Man"
675 /* No category. RFC4229 */
676 #define MHD_HTTP_HEADER_C_OPT "C-Opt"
677 /* No category. RFC4229 */
678 #define MHD_HTTP_HEADER_C_PEP "C-PEP"
679 /* No category. RFC4229 */
680 #define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info"
681 /* Standard. RFC8607, Section 5.1 */
682 #define MHD_HTTP_HEADER_CAL_MANAGED_ID "Cal-Managed-ID"
683 /* Standard. RFC7809, Section 7.1 */
684 #define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
685 /* Standard. RFC8586 */
686 #define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop"
687 /* Obsoleted. RFC2068; RFC2616 */
688 #define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
689 /* Standard. RFC6266 */
690 #define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition"
691 /* No category. RFC4229 */
692 #define MHD_HTTP_HEADER_CONTENT_ID "Content-ID"
693 /* No category. RFC4229 */
694 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
695 /* No category. RFC4229 */
696 #define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type"
697 /* No category. RFC4229 */
698 #define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type"
699 /* No category. RFC4229 */
700 #define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version"
701 /* Standard. RFC6265 */
702 #define MHD_HTTP_HEADER_COOKIE "Cookie"
703 /* Obsoleted. RFC2965; RFC6265 */
704 #define MHD_HTTP_HEADER_COOKIE2 "Cookie2"
705 /* Standard. RFC5323 */
706 #define MHD_HTTP_HEADER_DASL "DASL"
707 /* Standard. RFC4918 */
708 #define MHD_HTTP_HEADER_DAV "DAV"
709 /* No category. RFC4229 */
710 #define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style"
711 /* No category. RFC4229 */
712 #define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base"
713 /* Standard. RFC4918 */
714 #define MHD_HTTP_HEADER_DEPTH "Depth"
715 /* No category. RFC4229 */
716 #define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From"
717 /* Standard. RFC4918 */
718 #define MHD_HTTP_HEADER_DESTINATION "Destination"
719 /* No category. RFC4229 */
720 #define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID"
721 /* No category. RFC4229 */
722 #define MHD_HTTP_HEADER_DIGEST "Digest"
723 /* Standard. RFC8470 */
724 #define MHD_HTTP_HEADER_EARLY_DATA "Early-Data"
725 /* Experimental. RFC-ietf-httpbis-expect-ct-08 */
726 #define MHD_HTTP_HEADER_EXPECT_CT "Expect-CT"
727 /* No category. RFC4229 */
728 #define MHD_HTTP_HEADER_EXT "Ext"
729 /* Standard. RFC7239 */
730 #define MHD_HTTP_HEADER_FORWARDED "Forwarded"
731 /* No category. RFC4229 */
732 #define MHD_HTTP_HEADER_GETPROFILE "GetProfile"
733 /* Experimental. RFC7486, Section 6.1.1 */
734 #define MHD_HTTP_HEADER_HOBAREG "Hobareg"
735 /* Standard. RFC7540, Section 3.2.1 */
736 #define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings"
737 /* No category. RFC4229 */
738 #define MHD_HTTP_HEADER_IM "IM"
739 /* Standard. RFC4918 */
740 #define MHD_HTTP_HEADER_IF "If"
741 /* Standard. RFC6638 */
742 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
743 /* Standard. RFC8473 */
744 #define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID \
745  "Include-Referred-Token-Binding-ID"
746 /* No category. RFC4229 */
747 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
748 /* No category. RFC4229 */
749 #define MHD_HTTP_HEADER_LABEL "Label"
750 /* Standard. RFC8288 */
751 #define MHD_HTTP_HEADER_LINK "Link"
752 /* Standard. RFC4918 */
753 #define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token"
754 /* No category. RFC4229 */
755 #define MHD_HTTP_HEADER_MAN "Man"
756 /* Informational. RFC7089 */
757 #define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime"
758 /* No category. RFC4229 */
759 #define MHD_HTTP_HEADER_METER "Meter"
760 /* No category. RFC4229 */
761 #define MHD_HTTP_HEADER_NEGOTIATE "Negotiate"
762 /* No category. RFC4229 */
763 #define MHD_HTTP_HEADER_OPT "Opt"
764 /* Experimental. RFC8053, Section 3 */
765 #define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate"
766 /* Standard. RFC4229 */
767 #define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
768 /* Standard. RFC6454 */
769 #define MHD_HTTP_HEADER_ORIGIN "Origin"
770 /* Standard. RFC-ietf-core-object-security-16, Section 11.1 */
771 #define MHD_HTTP_HEADER_OSCORE "OSCORE"
772 /* Standard. RFC4918 */
773 #define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
774 /* No category. RFC4229 */
775 #define MHD_HTTP_HEADER_P3P "P3P"
776 /* No category. RFC4229 */
777 #define MHD_HTTP_HEADER_PEP "PEP"
778 /* No category. RFC4229 */
779 #define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label"
780 /* No category. RFC4229 */
781 #define MHD_HTTP_HEADER_PEP_INFO "Pep-Info"
782 /* Standard. RFC4229 */
783 #define MHD_HTTP_HEADER_POSITION "Position"
784 /* Standard. RFC7240 */
785 #define MHD_HTTP_HEADER_PREFER "Prefer"
786 /* Standard. RFC7240 */
787 #define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied"
788 /* No category. RFC4229 */
789 #define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject"
790 /* No category. RFC4229 */
791 #define MHD_HTTP_HEADER_PROTOCOL "Protocol"
792 /* No category. RFC4229 */
793 #define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info"
794 /* No category. RFC4229 */
795 #define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query"
796 /* No category. RFC4229 */
797 #define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request"
798 /* Standard. RFC7615, Section 4 */
799 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info"
800 /* No category. RFC4229 */
801 #define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features"
802 /* No category. RFC4229 */
803 #define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction"
804 /* No category. RFC4229 */
805 #define MHD_HTTP_HEADER_PUBLIC "Public"
806 /* Standard. RFC7469 */
807 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
808 /* Standard. RFC7469 */
809 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \
810  "Public-Key-Pins-Report-Only"
811 /* No category. RFC4437 */
812 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
813 /* Standard. RFC8555, Section 6.5.1 */
814 #define MHD_HTTP_HEADER_REPLAY_NONCE "Replay-Nonce"
815 /* No category. RFC4229 */
816 #define MHD_HTTP_HEADER_SAFE "Safe"
817 /* Standard. RFC6638 */
818 #define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply"
819 /* Standard. RFC6638 */
820 #define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag"
821 /* Standard. RFC8473 */
822 #define MHD_HTTP_HEADER_SEC_TOKEN_BINDING "Sec-Token-Binding"
823 /* Standard. RFC6455 */
824 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept"
825 /* Standard. RFC6455 */
826 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions"
827 /* Standard. RFC6455 */
828 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key"
829 /* Standard. RFC6455 */
830 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol"
831 /* Standard. RFC6455 */
832 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version"
833 /* No category. RFC4229 */
834 #define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme"
835 /* Standard. RFC6265 */
836 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
837 /* Obsoleted. RFC2965; RFC6265 */
838 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
839 /* No category. RFC4229 */
840 #define MHD_HTTP_HEADER_SETPROFILE "SetProfile"
841 /* Standard. RFC5023 */
842 #define MHD_HTTP_HEADER_SLUG "SLUG"
843 /* No category. RFC4229 */
844 #define MHD_HTTP_HEADER_SOAPACTION "SoapAction"
845 /* No category. RFC4229 */
846 #define MHD_HTTP_HEADER_STATUS_URI "Status-URI"
847 /* Standard. RFC6797 */
848 #define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security"
849 /* Informational. RFC8594 */
850 #define MHD_HTTP_HEADER_SUNSET "Sunset"
851 /* No category. RFC4229 */
852 #define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability"
853 /* No category. RFC4229 */
854 #define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control"
855 /* No category. RFC4229 */
856 #define MHD_HTTP_HEADER_TCN "TCN"
857 /* Standard. RFC4918 */
858 #define MHD_HTTP_HEADER_TIMEOUT "Timeout"
859 /* Standard. RFC8030, Section 5.4 */
860 #define MHD_HTTP_HEADER_TOPIC "Topic"
861 /* Standard. RFC8030, Section 5.2 */
862 #define MHD_HTTP_HEADER_TTL "TTL"
863 /* Standard. RFC8030, Section 5.3 */
864 #define MHD_HTTP_HEADER_URGENCY "Urgency"
865 /* No category. RFC4229 */
866 #define MHD_HTTP_HEADER_URI "URI"
867 /* No category. RFC4229 */
868 #define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary"
869 /* No category. RFC4229 */
870 #define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest"
871 /* Standard. https://fetch.spec.whatwg.org/#x-content-type-options-header */
872 #define MHD_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS "X-Content-Type-Options"
873 /* Informational. RFC7034 */
874 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
875 
876 /* Some provisional headers. */
877 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \
878  "Access-Control-Allow-Origin"
879  /* end of group headers */
880 
887 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
888 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
889  /* end of group versions */
891 
900 /* Main HTTP methods. */
901 /* Not safe. Not idempotent. RFC7231, Section 4.3.6. */
902 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
903 /* Not safe. Idempotent. RFC7231, Section 4.3.5. */
904 #define MHD_HTTP_METHOD_DELETE "DELETE"
905 /* Safe. Idempotent. RFC7231, Section 4.3.1. */
906 #define MHD_HTTP_METHOD_GET "GET"
907 /* Safe. Idempotent. RFC7231, Section 4.3.2. */
908 #define MHD_HTTP_METHOD_HEAD "HEAD"
909 /* Safe. Idempotent. RFC7231, Section 4.3.7. */
910 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
911 /* Not safe. Not idempotent. RFC7231, Section 4.3.3. */
912 #define MHD_HTTP_METHOD_POST "POST"
913 /* Not safe. Idempotent. RFC7231, Section 4.3.4. */
914 #define MHD_HTTP_METHOD_PUT "PUT"
915 /* Safe. Idempotent. RFC7231, Section 4.3.8. */
916 #define MHD_HTTP_METHOD_TRACE "TRACE"
917 
918 /* Additional HTTP methods. */
919 /* Not safe. Idempotent. RFC3744, Section 8.1. */
920 #define MHD_HTTP_METHOD_ACL "ACL"
921 /* Not safe. Idempotent. RFC3253, Section 12.6. */
922 #define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL"
923 /* Not safe. Idempotent. RFC5842, Section 4. */
924 #define MHD_HTTP_METHOD_BIND "BIND"
925 /* Not safe. Idempotent. RFC3253, Section 4.4, Section 9.4. */
926 #define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
927 /* Not safe. Idempotent. RFC3253, Section 4.3, Section 8.8. */
928 #define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
929 /* Not safe. Idempotent. RFC4918, Section 9.8. */
930 #define MHD_HTTP_METHOD_COPY "COPY"
931 /* Not safe. Idempotent. RFC3253, Section 8.2. */
932 #define MHD_HTTP_METHOD_LABEL "LABEL"
933 /* Not safe. Idempotent. RFC2068, Section 19.6.1.2. */
934 #define MHD_HTTP_METHOD_LINK "LINK"
935 /* Not safe. Not idempotent. RFC4918, Section 9.10. */
936 #define MHD_HTTP_METHOD_LOCK "LOCK"
937 /* Not safe. Idempotent. RFC3253, Section 11.2. */
938 #define MHD_HTTP_METHOD_MERGE "MERGE"
939 /* Not safe. Idempotent. RFC3253, Section 13.5. */
940 #define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
941 /* Not safe. Idempotent. RFC4791, Section 5.3.1; RFC8144, Section 2.3. */
942 #define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
943 /* Not safe. Idempotent. RFC4918, Section 9.3; RFC5689, Section 3; RFC8144, Section 2.3. */
944 #define MHD_HTTP_METHOD_MKCOL "MKCOL"
945 /* Not safe. Idempotent. RFC4437, Section 6. */
946 #define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
947 /* Not safe. Idempotent. RFC3253, Section 6.3. */
948 #define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
949 /* Not safe. Idempotent. RFC4918, Section 9.9. */
950 #define MHD_HTTP_METHOD_MOVE "MOVE"
951 /* Not safe. Idempotent. RFC3648, Section 7. */
952 #define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
953 /* Not safe. Not idempotent. RFC5789, Section 2. */
954 #define MHD_HTTP_METHOD_PATCH "PATCH"
955 /* Safe. Idempotent. RFC7540, Section 3.5. */
956 #define MHD_HTTP_METHOD_PRI "PRI"
957 /* Safe. Idempotent. RFC4918, Section 9.1; RFC8144, Section 2.1. */
958 #define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
959 /* Not safe. Idempotent. RFC4918, Section 9.2; RFC8144, Section 2.2. */
960 #define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
961 /* Not safe. Idempotent. RFC5842, Section 6. */
962 #define MHD_HTTP_METHOD_REBIND "REBIND"
963 /* Safe. Idempotent. RFC3253, Section 3.6; RFC8144, Section 2.1. */
964 #define MHD_HTTP_METHOD_REPORT "REPORT"
965 /* Safe. Idempotent. RFC5323, Section 2. */
966 #define MHD_HTTP_METHOD_SEARCH "SEARCH"
967 /* Not safe. Idempotent. RFC5842, Section 5. */
968 #define MHD_HTTP_METHOD_UNBIND "UNBIND"
969 /* Not safe. Idempotent. RFC3253, Section 4.5. */
970 #define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
971 /* Not safe. Idempotent. RFC2068, Section 19.6.1.3. */
972 #define MHD_HTTP_METHOD_UNLINK "UNLINK"
973 /* Not safe. Idempotent. RFC4918, Section 9.11. */
974 #define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
975 /* Not safe. Idempotent. RFC3253, Section 7.1. */
976 #define MHD_HTTP_METHOD_UPDATE "UPDATE"
977 /* Not safe. Idempotent. RFC4437, Section 7. */
978 #define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF"
979 /* Not safe. Idempotent. RFC3253, Section 3.5. */
980 #define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL"
981  /* end of group methods */
983 
989 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \
990  "application/x-www-form-urlencoded"
991 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
992  /* end of group postenc */
994 
995 
1000 struct MHD_Daemon;
1001 
1010 struct MHD_Connection;
1011 
1016 struct MHD_Response;
1017 
1022 struct MHD_PostProcessor;
1023 
1024 
1038 {
1043 
1050 
1056 
1061 
1064 #if 0
1065  /* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */
1066 #define MHD_USE_SSL \
1067  _MHD_DEPR_IN_MACRO ("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
1068  MHD_USE_TLS
1069 #endif
1070 
1076 
1087 
1090 #if 0 /* Will be marked for real deprecation later. */
1091 #define MHD_USE_SELECT_INTERNALLY \
1092  _MHD_DEPR_IN_MACRO ( \
1093  "Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \
1094  MHD_USE_INTERNAL_POLLING_THREAD
1095 #endif /* 0 */
1096 
1105 
1116 #if 0 /* Will be marked for real deprecation later. */
1117 #define MHD_USE_PEDANTIC_CHECKS \
1118  _MHD_DEPR_IN_MACRO ( \
1119  "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \
1120  32
1121 #endif /* 0 */
1122 
1132 
1138 
1141 #if 0 /* Will be marked for real deprecation later. */
1142 #define MHD_USE_POLL_INTERNALLY \
1143  _MHD_DEPR_IN_MACRO ( \
1144  "Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \
1145  MHD_USE_POLL_INTERNAL_THREAD
1146 #endif /* 0 */
1147 
1155 
1158 #if 0 /* Will be marked for real deprecation later. */
1159 #define MHD_SUPPRESS_DATE_NO_CLOCK \
1160  _MHD_DEPR_IN_MACRO ( \
1161  "Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
1162  MHD_USE_SUPPRESS_DATE_NO_CLOCK
1163 #endif /* 0 */
1164 
1173 
1182 
1185 #if 0 /* Will be marked for real deprecation later. */
1186 #define MHD_USE_EPOLL_LINUX_ONLY \
1187  _MHD_DEPR_IN_MACRO ( \
1188  "Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
1189  MHD_USE_EPOLL
1190 #endif /* 0 */
1191 
1200 
1206 #if 0 /* Will be marked for real deprecation later. */
1207 #define MHD_USE_EPOLL_INTERNALLY \
1208  _MHD_DEPR_IN_MACRO ( \
1209  "Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1210  MHD_USE_EPOLL_INTERNAL_THREAD
1211 
1212 #define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \
1213  _MHD_DEPR_IN_MACRO ( \
1214  "Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1215  MHD_USE_EPOLL_INTERNAL_THREAD
1216 #endif /* 0 */
1217 
1230  MHD_USE_ITC = 1024,
1231 
1234 #if 0 /* Will be marked for real deprecation later. */
1235 #define MHD_USE_PIPE_FOR_SHUTDOWN \
1236  _MHD_DEPR_IN_MACRO ( \
1237  "Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
1238  MHD_USE_ITC
1239 #endif /* 0 */
1240 
1245 
1253 
1256 #if 0 /* Will be marked for real deprecation later. */
1257 #define MHD_USE_EPOLL_TURBO \
1258  _MHD_DEPR_IN_MACRO ( \
1259  "Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
1260  MHD_USE_TURBO
1261 #endif /* 0 */
1262 
1268 
1271 #if 0 /* Will be marked for real deprecation later. */
1272 #define MHD_USE_SUSPEND_RESUME \
1273  _MHD_DEPR_IN_MACRO ( \
1274  "Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \
1275  MHD_ALLOW_SUSPEND_RESUME
1276 #endif /* 0 */
1277 
1284 
1291 
1303  MHD_USE_AUTO = 65536,
1304 
1312 
1318 
1324 
1325 };
1326 
1327 
1336 typedef void
1337 (*MHD_LogCallback)(void *cls,
1338  const char *fm,
1339  va_list ap);
1340 
1341 
1354 typedef int
1356  const struct MHD_Connection *connection,
1357  const char *username,
1358  void **psk,
1359  size_t *psk_size);
1360 
1367 {
1368 
1374 
1383 
1389 
1396 
1410 
1422 
1430 
1462 
1470 
1478 
1485 
1491 
1499 
1512 
1522 
1543 
1565 
1576 
1583 
1589 
1596 
1602 
1618 
1627 
1634 
1643 
1652 
1663 
1671 
1687 
1695 
1706 
1717 };
1718 
1719 
1725 {
1730 
1731 };
1732 
1733 
1738 {
1744 
1750  intptr_t value;
1751 
1756  void *ptr_value;
1757 
1758 };
1759 
1760 
1766 {
1767 
1773 #define MHD_RESPONSE_HEADER_KIND \
1774  _MHD_DEPR_IN_MACRO ( \
1775  "Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
1776  MHD_RESPONSE_HEADER_KIND
1777 
1782 
1788 
1798 
1803 
1808 };
1809 
1810 
1817 {
1818 
1824 
1832 
1840 
1847 
1857 
1865 
1866 };
1867 
1868 
1875 {
1876 
1882 
1888 
1889 };
1890 
1891 
1896 {
1897 
1901  int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
1902 
1906  int /* enum gnutls_protocol */ protocol;
1907 
1911  int /* MHD_YES or MHD_NO */ suspended;
1912 
1918  unsigned int connection_timeout;
1919 
1924 
1928  size_t header_size;
1929 
1933  void * /* gnutls_session_t */ tls_session;
1934 
1938  void * /* gnutls_x509_crt_t */ client_cert;
1939 
1943  struct sockaddr *client_addr;
1944 
1950 
1956 };
1957 
1958 
1965 {
1972 
1979 
1988 
1994 
2002 
2008 
2016 
2026 
2032 
2038 
2044 };
2045 
2046 
2052 {
2057 
2062 
2068 
2077 
2086 
2094 
2102 };
2103 
2104 
2115 typedef void
2116 (*MHD_PanicCallback) (void *cls,
2117  const char *file,
2118  unsigned int line,
2119  const char *reason);
2120 
2129 typedef enum MHD_Result
2131  const struct sockaddr *addr,
2132  socklen_t addrlen);
2133 
2134 
2174 typedef enum MHD_Result
2176  struct MHD_Connection *connection,
2177  const char *url,
2178  const char *method,
2179  const char *version,
2180  const char *upload_data,
2181  size_t *upload_data_size,
2182  void **con_cls);
2183 
2184 
2197 typedef void
2199  struct MHD_Connection *connection,
2200  void **con_cls,
2201  enum MHD_RequestTerminationCode toe);
2202 
2203 
2223 typedef void
2225  struct MHD_Connection *connection,
2226  void **socket_context,
2228 
2229 
2245 typedef enum MHD_Result
2247  enum MHD_ValueKind kind,
2248  const char *key,
2249  const char *value);
2250 
2251 
2270 typedef enum MHD_Result
2272  enum MHD_ValueKind kind,
2273  const char *key,
2274  size_t key_size,
2275  const char *value,
2276  size_t value_size);
2277 
2278 
2323 typedef ssize_t
2325  uint64_t pos,
2326  char *buf,
2327  size_t max);
2328 
2329 
2339 typedef void
2341 
2342 
2362 typedef enum MHD_Result
2364  enum MHD_ValueKind kind,
2365  const char *key,
2366  const char *filename,
2367  const char *content_type,
2368  const char *transfer_encoding,
2369  const char *data,
2370  uint64_t off,
2371  size_t size);
2372 
2373 /* **************** Daemon handling functions ***************** */
2374 
2396 _MHD_EXTERN struct MHD_Daemon *
2397 MHD_start_daemon_va (unsigned int flags,
2398  uint16_t port,
2400  MHD_AccessHandlerCallback dh, void *dh_cls,
2401  va_list ap);
2402 
2403 
2424 _MHD_EXTERN struct MHD_Daemon *
2425 MHD_start_daemon (unsigned int flags,
2426  uint16_t port,
2428  MHD_AccessHandlerCallback dh, void *dh_cls,
2429  ...);
2430 
2431 
2452 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
2453 
2454 
2461 _MHD_EXTERN void
2462 MHD_stop_daemon (struct MHD_Daemon *daemon);
2463 
2464 
2493 MHD_add_connection (struct MHD_Daemon *daemon,
2494  MHD_socket client_socket,
2495  const struct sockaddr *addr,
2496  socklen_t addrlen);
2497 
2498 
2529 MHD_get_fdset (struct MHD_Daemon *daemon,
2530  fd_set *read_fd_set,
2531  fd_set *write_fd_set,
2532  fd_set *except_fd_set,
2533  MHD_socket *max_fd);
2534 
2535 
2569 MHD_get_fdset2 (struct MHD_Daemon *daemon,
2570  fd_set *read_fd_set,
2571  fd_set *write_fd_set,
2572  fd_set *except_fd_set,
2573  MHD_socket *max_fd,
2574  unsigned int fd_setsize);
2575 
2576 
2601 #define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
2602  MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \
2603  (max_fd),FD_SETSIZE)
2604 
2605 
2625 MHD_get_timeout (struct MHD_Daemon *daemon,
2626  MHD_UNSIGNED_LONG_LONG *timeout);
2627 
2628 
2650 MHD_run (struct MHD_Daemon *daemon);
2651 
2652 
2676 MHD_run_from_select (struct MHD_Daemon *daemon,
2677  const fd_set *read_fd_set,
2678  const fd_set *write_fd_set,
2679  const fd_set *except_fd_set);
2680 
2681 
2682 /* **************** Connection handling functions ***************** */
2683 
2696 _MHD_EXTERN int
2697 MHD_get_connection_values (struct MHD_Connection *connection,
2698  enum MHD_ValueKind kind,
2699  MHD_KeyValueIterator iterator,
2700  void *iterator_cls);
2701 
2702 
2715 _MHD_EXTERN int
2716 MHD_get_connection_values_n (struct MHD_Connection *connection,
2717  enum MHD_ValueKind kind,
2718  MHD_KeyValueIteratorN iterator,
2719  void *iterator_cls);
2720 
2721 
2749 MHD_set_connection_value (struct MHD_Connection *connection,
2750  enum MHD_ValueKind kind,
2751  const char *key,
2752  const char *value);
2753 
2754 
2781 MHD_set_connection_value_n (struct MHD_Connection *connection,
2782  enum MHD_ValueKind kind,
2783  const char *key,
2784  size_t key_size,
2785  const char *value,
2786  size_t value_size);
2787 
2788 
2805 _MHD_EXTERN void
2806 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
2807 
2808 
2818 _MHD_EXTERN size_t
2819 MHD_http_unescape (char *val);
2820 
2821 
2832 _MHD_EXTERN const char *
2833 MHD_lookup_connection_value (struct MHD_Connection *connection,
2834  enum MHD_ValueKind kind,
2835  const char *key);
2836 
2837 
2858 MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2859  enum MHD_ValueKind kind,
2860  const char *key,
2861  size_t key_size,
2862  const char **value_ptr,
2863  size_t *value_size_ptr);
2864 
2865 
2878 MHD_queue_response (struct MHD_Connection *connection,
2879  unsigned int status_code,
2880  struct MHD_Response *response);
2881 
2882 
2908 _MHD_EXTERN void
2909 MHD_suspend_connection (struct MHD_Connection *connection);
2910 
2911 
2926 _MHD_EXTERN void
2927 MHD_resume_connection (struct MHD_Connection *connection);
2928 
2929 
2930 /* **************** Response manipulation functions ***************** */
2931 
2932 
2937 {
2942 
2953 
2960 
2966 
2967 
2968 };
2969 
2970 
2975 {
2980 };
2981 
2982 
2992 MHD_set_response_options (struct MHD_Response *response,
2993  enum MHD_ResponseFlags flags,
2994  ...);
2995 
2996 
3013 _MHD_EXTERN struct MHD_Response *
3014 MHD_create_response_from_callback (uint64_t size,
3015  size_t block_size,
3018 
3019 
3035  "MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
3036  _MHD_EXTERN struct MHD_Response *
3037 MHD_create_response_from_data (size_t size,
3038  void *data,
3039  int must_free,
3040  int must_copy);
3041 
3042 
3049 {
3050 
3058 
3066 
3075 
3076 };
3077 
3078 
3089 _MHD_EXTERN struct MHD_Response *
3090 MHD_create_response_from_buffer (size_t size,
3091  void *buffer,
3092  enum MHD_ResponseMemoryMode mode);
3093 
3094 
3105 _MHD_EXTERN struct MHD_Response *
3107  void *buffer,
3109  crfc);
3110 
3111 
3123 _MHD_EXTERN struct MHD_Response *
3124 MHD_create_response_from_fd (size_t size,
3125  int fd);
3126 
3127 
3141 _MHD_EXTERN struct MHD_Response *
3142 MHD_create_response_from_fd64 (uint64_t size,
3143  int fd);
3144 
3145 
3163  "Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3164  _MHD_EXTERN struct MHD_Response *
3166  int fd,
3167  off_t offset);
3168 
3169 #if ! defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
3170 /* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset()
3171  to minimize potential problems with different off_t sizes */
3172 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \
3173  _MHD_DEPR_IN_MACRO ( \
3174  "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3175  MHD_create_response_from_fd_at_offset64 ((size),(fd),(offset))
3176 #endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
3177 
3178 
3195 _MHD_EXTERN struct MHD_Response *
3197  int fd,
3198  uint64_t offset);
3199 
3200 
3208 {
3209 
3216 
3221 
3226 
3227 };
3228 
3229 
3235 struct MHD_UpgradeResponseHandle;
3236 
3237 
3251 MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3252  enum MHD_UpgradeAction action,
3253  ...);
3254 
3255 
3303 typedef void
3304 (*MHD_UpgradeHandler)(void *cls,
3305  struct MHD_Connection *connection,
3306  void *con_cls,
3307  const char *extra_in,
3308  size_t extra_in_size,
3309  MHD_socket sock,
3310  struct MHD_UpgradeResponseHandle *urh);
3311 
3312 
3342 _MHD_EXTERN struct MHD_Response *
3344  void *upgrade_handler_cls);
3345 
3346 
3356 _MHD_EXTERN void
3357 MHD_destroy_response (struct MHD_Response *response);
3358 
3359 
3371 MHD_add_response_header (struct MHD_Response *response,
3372  const char *header,
3373  const char *content);
3374 
3375 
3386 MHD_add_response_footer (struct MHD_Response *response,
3387  const char *footer,
3388  const char *content);
3389 
3390 
3401 MHD_del_response_header (struct MHD_Response *response,
3402  const char *header,
3403  const char *content);
3404 
3405 
3416 _MHD_EXTERN int
3417 MHD_get_response_headers (struct MHD_Response *response,
3418  MHD_KeyValueIterator iterator,
3419  void *iterator_cls);
3420 
3421 
3430 _MHD_EXTERN const char *
3431 MHD_get_response_header (struct MHD_Response *response,
3432  const char *key);
3433 
3434 
3435 /* ********************** PostProcessor functions ********************** */
3436 
3462 _MHD_EXTERN struct MHD_PostProcessor *
3463 MHD_create_post_processor (struct MHD_Connection *connection,
3464  size_t buffer_size,
3465  MHD_PostDataIterator iter, void *iter_cls);
3466 
3467 
3482 MHD_post_process (struct MHD_PostProcessor *pp,
3483  const char *post_data, size_t post_data_len);
3484 
3485 
3497 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
3498 
3499 
3500 /* ********************* Digest Authentication functions *************** */
3501 
3502 
3508 #define MHD_INVALID_NONCE -1
3509 
3510 
3519 _MHD_EXTERN char *
3520 MHD_digest_auth_get_username (struct MHD_Connection *connection);
3521 
3522 
3531 _MHD_EXTERN void
3532 MHD_free (void *ptr);
3533 
3534 
3539 {
3540 
3545 
3550 
3555 
3556 };
3557 
3558 
3573 _MHD_EXTERN int
3574 MHD_digest_auth_check2 (struct MHD_Connection *connection,
3575  const char *realm,
3576  const char *username,
3577  const char *password,
3578  unsigned int nonce_timeout,
3579  enum MHD_DigestAuthAlgorithm algo);
3580 
3581 
3600 _MHD_EXTERN int
3601 MHD_digest_auth_check (struct MHD_Connection *connection,
3602  const char *realm,
3603  const char *username,
3604  const char *password,
3605  unsigned int nonce_timeout);
3606 
3607 
3625 _MHD_EXTERN int
3626 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3627  const char *realm,
3628  const char *username,
3629  const uint8_t *digest,
3630  size_t digest_size,
3631  unsigned int nonce_timeout,
3632  enum MHD_DigestAuthAlgorithm algo);
3633 
3634 
3653 _MHD_EXTERN int
3654 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3655  const char *realm,
3656  const char *username,
3657  const uint8_t digest[MHD_MD5_DIGEST_SIZE],
3658  unsigned int nonce_timeout);
3659 
3660 
3677 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3678  const char *realm,
3679  const char *opaque,
3680  struct MHD_Response *response,
3681  int signal_stale,
3682  enum MHD_DigestAuthAlgorithm algo);
3683 
3684 
3703 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3704  const char *realm,
3705  const char *opaque,
3706  struct MHD_Response *response,
3707  int signal_stale);
3708 
3709 
3719 _MHD_EXTERN char *
3721  char**password);
3722 
3723 
3736 _MHD_EXTERN int
3738  const char *realm,
3739  struct MHD_Response *response);
3740 
3741 /* ********************** generic query functions ********************** */
3742 
3743 
3754 _MHD_EXTERN const union MHD_ConnectionInfo *
3755 MHD_get_connection_info (struct MHD_Connection *connection,
3756  enum MHD_ConnectionInfoType info_type,
3757  ...);
3758 
3759 
3765 {
3766 
3775 
3776 };
3777 
3778 
3789 MHD_set_connection_option (struct MHD_Connection *connection,
3790  enum MHD_CONNECTION_OPTION option,
3791  ...);
3792 
3793 
3798 {
3803  size_t key_size;
3804 
3810 
3815 
3819  uint16_t port;
3820 
3825 
3829  unsigned int num_connections;
3830 
3838 };
3839 
3840 
3852 _MHD_EXTERN const union MHD_DaemonInfo *
3853 MHD_get_daemon_info (struct MHD_Daemon *daemon,
3854  enum MHD_DaemonInfoType info_type,
3855  ...);
3856 
3857 
3864 _MHD_EXTERN const char*
3865 MHD_get_version (void);
3866 
3867 
3873 {
3879 
3889 
3895 
3901 
3909 
3915 
3922 
3929 
3935 
3942 
3949 
3957 
3965 
3972 
3982 
3988 
3995 
4008 
4014 
4021 
4028 
4033 
4039 };
4040 
4041 
4054 MHD_is_feature_supported (enum MHD_FEATURE feature);
4055 
4056 
4057 #if 0 /* keep Emacsens' auto-indent happy */
4058 {
4059 #endif
4060 #ifdef __cplusplus
4061 }
4062 #endif
4063 
4064 #endif
#define _MHD_DEPR_FUNC(msg)
Definition: microhttpd.h:285
_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:285
enum MHD_Result(* 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:2363
_MHD_EXTERN enum MHD_Result MHD_add_response_footer(struct MHD_Response *response, const char *footer, const char *content)
Definition: response.c:177
enum MHD_Result(* 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:2175
_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:5698
_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:375
_MHD_EXTERN const char * MHD_get_version(void)
Definition: version.c:35
size_t mac_key_size
Definition: microhttpd.h:3809
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
Definition: connection.c:475
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
Definition: microhttpd.h:1355
MHD_socket listen_fd
Definition: microhttpd.h:3814
void * data
Definition: microhttpd.h:3038
_MHD_EXTERN enum MHD_Result MHD_set_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: connection.c:446
void int int must_copy
Definition: microhttpd.h:3038
_MHD_EXTERN enum MHD_Result MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:3837
_MHD_EXTERN enum MHD_Result MHD_get_timeout(struct MHD_Daemon *daemon, MHD_UNSIGNED_LONG_LONG *timeout)
Definition: daemon.c:3447
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1606
_MHD_EXTERN enum MHD_Result 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:512
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2340
char * version
Definition: internal.h:724
_MHD_EXTERN int MHD_queue_basic_auth_fail_response(struct MHD_Connection *connection, const char *realm, struct MHD_Response *response)
Definition: basicauth.c:124
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd64(uint64_t size, int fd)
Definition: response.c:656
_MHD_EXTERN enum MHD_Result MHD_upgrade_action(struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action,...)
MHD_RequestTerminationCode
Definition: microhttpd.h:1816
MHD_socket connect_fd
Definition: microhttpd.h:1923
int MHD_socket
Definition: microhttpd.h:195
_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:1156
_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:4833
intptr_t value
Definition: microhttpd.h:1750
MHD_ConnectionNotificationCode
Definition: microhttpd.h:1874
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
Definition: panic.c:56
#define MHD_UNSIGNED_LONG_LONG
Definition: microhttpd.h:298
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:2116
_MHD_EXTERN struct MHD_PostProcessor * MHD_create_post_processor(struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iter, void *iter_cls)
_MHD_EXTERN enum MHD_Result MHD_run(struct MHD_Daemon *daemon)
Definition: daemon.c:4677
void(* MHD_LogCallback)(void *cls, const char *fm, va_list ap)
Definition: microhttpd.h:1337
MHD_ResponseOptions
Definition: microhttpd.h:2974
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:3777
void * socket_context
Definition: internal.h:694
#define MHD_MD5_DIGEST_SIZE
Definition: microhttpd.h:322
MHD_CONNECTION_OPTION
Definition: microhttpd.h:3764
_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:1594
enum MHD_Result(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2130
MHD_DisableSanityCheck
Definition: microhttpd.h:1724
int fd
Definition: microhttpd.h:3166
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:6816
const char * url
Definition: internal.h:718
_MHD_EXTERN enum MHD_Result 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:1129
_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:1231
_MHD_EXTERN enum MHD_Result MHD_add_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:133
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd_at_offset64(uint64_t size, int fd, uint64_t offset)
Definition: response.c:591
char * method
Definition: internal.h:712
#define _MHD_EXTERN
Definition: microhttpd.h:185
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2324
MHD_DigestAuthAlgorithm
Definition: microhttpd.h:3538
_MHD_EXTERN enum MHD_Result MHD_is_feature_supported(enum MHD_FEATURE feature)
Definition: daemon.c:7097
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
Definition: digestauth.c:628
_MHD_EXTERN enum MHD_Result MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
_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:1269
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
Definition: response.c:1214
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
Definition: daemon.c:2905
_MHD_EXTERN enum MHD_Result 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:3641
void int must_free
Definition: microhttpd.h:3038
uint16_t port
Definition: internal.h:1605
_MHD_EXTERN enum MHD_Result MHD_post_process(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
Definition: response.c:680
MHD_ValueKind
Definition: microhttpd.h:1765
_MHD_EXTERN enum MHD_Result MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:3903
_MHD_EXTERN enum MHD_Result MHD_add_connection(struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen)
Definition: daemon.c:3128
struct MHD_Daemon * daemon
Definition: microhttpd.h:1949
#define MHD_create_response_from_fd_at_offset(size, fd, offset)
Definition: microhttpd.h:3172
MHD_FEATURE
Definition: microhttpd.h:3872
MHD_ConnectionInfoType
Definition: microhttpd.h:1964
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
Definition: response.c:633
MHD_Result
Definition: microhttpd.h:140
int off_t offset
Definition: microhttpd.h:3166
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
Definition: response.c:738
unsigned int connection_timeout
Definition: microhttpd.h:1918
MHD_AcceptPolicyCallback apc
Definition: internal.h:1361
uint16_t port
Definition: microhttpd.h:3819
_MHD_EXTERN enum MHD_Result MHD_set_response_options(struct MHD_Response *response, enum MHD_ResponseFlags flags,...)
Definition: response.c:416
enum MHD_Result(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: microhttpd.h:2246
enum MHD_Result(* 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:2271
_MHD_EXTERN struct MHD_Response * MHD_create_response_for_upgrade(MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls)
void * ptr_value
Definition: microhttpd.h:1756
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:2198
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:3304
_MHD_EXTERN void MHD_free(void *ptr)
Definition: memorypool.c:89
_MHD_EXTERN int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: connection.c:246
_MHD_EXTERN enum MHD_Result 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:399
MHD_OPTION
MHD options.
Definition: microhttpd.h:1366
_MHD_EXTERN enum MHD_Result 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
enum MHD_FLAG flags
Definition: microhttpd.h:3837
void * apc_cls
Definition: internal.h:1366
#define MHD_get_fdset(daemon, read_fd_set, write_fd_set, except_fd_set, max_fd)
Definition: microhttpd.h:2601
MHD_ContentReaderCallback crc
Definition: internal.h:1600
MHD_UpgradeAction
Definition: microhttpd.h:3207
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer_with_free_callback(size_t size, void *buffer, MHD_ContentReaderFreeCallback crfc)
Definition: response.c:760
_MHD_EXTERN enum MHD_Result MHD_del_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:198
_MHD_EXTERN enum MHD_Result 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:1465
MHD_DaemonInfoType
Definition: microhttpd.h:2051
struct sockaddr * client_addr
Definition: microhttpd.h:1943
#define _MHD_DEPR_MACRO(msg)
Definition: microhttpd.h:254
MHD_ResponseFlags
Definition: microhttpd.h:2936
_MHD_EXTERN const char * MHD_get_response_header(struct MHD_Response *response, const char *key)
Definition: response.c:284
_MHD_EXTERN MHD_socket MHD_quiesce_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:4878
unsigned int num_connections
Definition: microhttpd.h:3829
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2224
_MHD_EXTERN const union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
Definition: daemon.c:6982
_MHD_EXTERN size_t MHD_http_unescape(char *val)
Definition: internal.c:142
_MHD_EXTERN const char * MHD_get_reason_phrase_for(unsigned int code)
enum MHD_OPTION option
Definition: microhttpd.h:1743
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1037
#define MHD_RESPONSE_HEADER_KIND
Definition: microhttpd.h:1773
_MHD_EXTERN int MHD_get_response_headers(struct MHD_Response *response, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: response.c:252
MHD_ResponseMemoryMode
Definition: microhttpd.h:3048
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:2936