GNU libmicrohttpd  0.9.65
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 0x00096500
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 };
1651 
1652 
1657 {
1663 
1669  intptr_t value;
1670 
1675  void *ptr_value;
1676 
1677 };
1678 
1679 
1685 {
1686 
1692 #define MHD_RESPONSE_HEADER_KIND \
1693  _MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
1694  MHD_RESPONSE_HEADER_KIND
1695 
1700 
1706 
1716 
1721 
1726 };
1727 
1728 
1735 {
1736 
1742 
1750 
1758 
1765 
1775 
1783 
1784 };
1785 
1786 
1793 {
1794 
1800 
1806 
1807 };
1808 
1809 
1814 {
1815 
1819  int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
1820 
1824  int /* enum gnutls_protocol */ protocol;
1825 
1829  int /* MHD_YES or MHD_NO */ suspended;
1830 
1836  unsigned int connection_timeout;
1837 
1842 
1846  size_t header_size;
1847 
1851  void * /* gnutls_session_t */ tls_session;
1852 
1856  void * /* gnutls_x509_crt_t */ client_cert;
1857 
1861  struct sockaddr *client_addr;
1862 
1868 
1874 };
1875 
1876 
1883 {
1890 
1897 
1906 
1912 
1920 
1926 
1933 
1943 
1949 
1955 
1961 };
1962 
1963 
1969 {
1974 
1979 
1985 
1994 
2003 
2011 
2019 };
2020 
2021 
2032 typedef void
2033 (*MHD_PanicCallback) (void *cls,
2034  const char *file,
2035  unsigned int line,
2036  const char *reason);
2037 
2046 typedef int
2048  const struct sockaddr *addr,
2049  socklen_t addrlen);
2050 
2051 
2091 typedef int
2093  struct MHD_Connection *connection,
2094  const char *url,
2095  const char *method,
2096  const char *version,
2097  const char *upload_data,
2098  size_t *upload_data_size,
2099  void **con_cls);
2100 
2101 
2114 typedef void
2116  struct MHD_Connection *connection,
2117  void **con_cls,
2118  enum MHD_RequestTerminationCode toe);
2119 
2120 
2140 typedef void
2142  struct MHD_Connection *connection,
2143  void **socket_context,
2145 
2146 
2162 typedef int
2163 (*MHD_KeyValueIterator) (void *cls,
2164  enum MHD_ValueKind kind,
2165  const char *key,
2166  const char *value);
2167 
2168 
2187 typedef int
2189  enum MHD_ValueKind kind,
2190  const char *key,
2191  size_t key_size,
2192  const char *value,
2193  size_t value_size);
2194 
2195 
2240 typedef ssize_t
2242  uint64_t pos,
2243  char *buf,
2244  size_t max);
2245 
2246 
2256 typedef void
2258 
2259 
2279 typedef int
2280 (*MHD_PostDataIterator) (void *cls,
2281  enum MHD_ValueKind kind,
2282  const char *key,
2283  const char *filename,
2284  const char *content_type,
2285  const char *transfer_encoding,
2286  const char *data,
2287  uint64_t off,
2288  size_t size);
2289 
2290 /* **************** Daemon handling functions ***************** */
2291 
2313 _MHD_EXTERN struct MHD_Daemon *
2314 MHD_start_daemon_va (unsigned int flags,
2315  uint16_t port,
2317  MHD_AccessHandlerCallback dh, void *dh_cls,
2318  va_list ap);
2319 
2320 
2341 _MHD_EXTERN struct MHD_Daemon *
2342 MHD_start_daemon (unsigned int flags,
2343  uint16_t port,
2345  MHD_AccessHandlerCallback dh, void *dh_cls,
2346  ...);
2347 
2348 
2369 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
2370 
2371 
2378 _MHD_EXTERN void
2379 MHD_stop_daemon (struct MHD_Daemon *daemon);
2380 
2381 
2409 _MHD_EXTERN int
2410 MHD_add_connection (struct MHD_Daemon *daemon,
2411  MHD_socket client_socket,
2412  const struct sockaddr *addr,
2413  socklen_t addrlen);
2414 
2415 
2445 _MHD_EXTERN int
2446 MHD_get_fdset (struct MHD_Daemon *daemon,
2447  fd_set *read_fd_set,
2448  fd_set *write_fd_set,
2449  fd_set *except_fd_set,
2450  MHD_socket *max_fd);
2451 
2452 
2485 _MHD_EXTERN int
2486 MHD_get_fdset2 (struct MHD_Daemon *daemon,
2487  fd_set *read_fd_set,
2488  fd_set *write_fd_set,
2489  fd_set *except_fd_set,
2490  MHD_socket *max_fd,
2491  unsigned int fd_setsize);
2492 
2493 
2518 #define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
2519  MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE)
2520 
2521 
2540 _MHD_EXTERN int
2541 MHD_get_timeout (struct MHD_Daemon *daemon,
2542  MHD_UNSIGNED_LONG_LONG *timeout);
2543 
2544 
2565 _MHD_EXTERN int
2566 MHD_run (struct MHD_Daemon *daemon);
2567 
2568 
2591 _MHD_EXTERN int
2592 MHD_run_from_select (struct MHD_Daemon *daemon,
2593  const fd_set *read_fd_set,
2594  const fd_set *write_fd_set,
2595  const fd_set *except_fd_set);
2596 
2597 
2598 
2599 
2600 /* **************** Connection handling functions ***************** */
2601 
2614 _MHD_EXTERN int
2615 MHD_get_connection_values (struct MHD_Connection *connection,
2616  enum MHD_ValueKind kind,
2617  MHD_KeyValueIterator iterator,
2618  void *iterator_cls);
2619 
2620 
2633 _MHD_EXTERN int
2634 MHD_get_connection_values_n (struct MHD_Connection *connection,
2635  enum MHD_ValueKind kind,
2636  MHD_KeyValueIteratorN iterator,
2637  void *iterator_cls);
2638 
2639 
2666 _MHD_EXTERN int
2667 MHD_set_connection_value (struct MHD_Connection *connection,
2668  enum MHD_ValueKind kind,
2669  const char *key,
2670  const char *value);
2671 
2672 
2698 int
2699 MHD_set_connection_value_n (struct MHD_Connection *connection,
2700  enum MHD_ValueKind kind,
2701  const char *key,
2702  size_t key_size,
2703  const char *value,
2704  size_t value_size);
2705 
2706 
2723 _MHD_EXTERN void
2724 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
2725 
2726 
2736 _MHD_EXTERN size_t
2737 MHD_http_unescape (char *val);
2738 
2739 
2750 _MHD_EXTERN const char *
2751 MHD_lookup_connection_value (struct MHD_Connection *connection,
2752  enum MHD_ValueKind kind,
2753  const char *key);
2754 
2755 
2775 _MHD_EXTERN int
2776 MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2777  enum MHD_ValueKind kind,
2778  const char *key,
2779  size_t key_size,
2780  const char **value_ptr,
2781  size_t *value_size_ptr);
2782 
2783 
2795 _MHD_EXTERN int
2796 MHD_queue_response (struct MHD_Connection *connection,
2797  unsigned int status_code,
2798  struct MHD_Response *response);
2799 
2800 
2826 _MHD_EXTERN void
2827 MHD_suspend_connection (struct MHD_Connection *connection);
2828 
2829 
2844 _MHD_EXTERN void
2845 MHD_resume_connection (struct MHD_Connection *connection);
2846 
2847 
2848 /* **************** Response manipulation functions ***************** */
2849 
2850 
2855 {
2860 
2871 
2878 
2879 };
2880 
2881 
2886 {
2891 };
2892 
2893 
2902 _MHD_EXTERN int
2903 MHD_set_response_options (struct MHD_Response *response,
2904  enum MHD_ResponseFlags flags,
2905  ...);
2906 
2907 
2924 _MHD_EXTERN struct MHD_Response *
2925 MHD_create_response_from_callback (uint64_t size,
2926  size_t block_size,
2929 
2930 
2945 _MHD_DEPR_FUNC("MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
2946 _MHD_EXTERN struct MHD_Response *
2947 MHD_create_response_from_data (size_t size,
2948  void *data,
2949  int must_free,
2950  int must_copy);
2951 
2952 
2959 {
2960 
2968 
2976 
2985 
2986 };
2987 
2988 
2999 _MHD_EXTERN struct MHD_Response *
3000 MHD_create_response_from_buffer (size_t size,
3001  void *buffer,
3002  enum MHD_ResponseMemoryMode mode);
3003 
3004 
3005 
3006 
3017 _MHD_EXTERN struct MHD_Response *
3019  void *buffer,
3021 
3022 
3034 _MHD_EXTERN struct MHD_Response *
3035 MHD_create_response_from_fd (size_t size,
3036  int fd);
3037 
3038 
3052 _MHD_EXTERN struct MHD_Response *
3053 MHD_create_response_from_fd64 (uint64_t size,
3054  int fd);
3055 
3056 
3073 _MHD_DEPR_FUNC("Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3074 _MHD_EXTERN struct MHD_Response *
3076  int fd,
3077  off_t offset);
3078 
3079 #if !defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
3080 /* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset()
3081  to minimize potential problems with different off_t sizes */
3082 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \
3083  _MHD_DEPR_IN_MACRO("Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3084  MHD_create_response_from_fd_at_offset64((size),(fd),(offset))
3085 #endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
3086 
3087 
3104 _MHD_EXTERN struct MHD_Response *
3106  int fd,
3107  uint64_t offset);
3108 
3109 
3117 {
3118 
3125 
3126 };
3127 
3128 
3134 struct MHD_UpgradeResponseHandle;
3135 
3136 
3149 _MHD_EXTERN int
3150 MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3151  enum MHD_UpgradeAction action,
3152  ...);
3153 
3154 
3202 typedef void
3203 (*MHD_UpgradeHandler)(void *cls,
3204  struct MHD_Connection *connection,
3205  void *con_cls,
3206  const char *extra_in,
3207  size_t extra_in_size,
3208  MHD_socket sock,
3209  struct MHD_UpgradeResponseHandle *urh);
3210 
3211 
3241 _MHD_EXTERN struct MHD_Response *
3243  void *upgrade_handler_cls);
3244 
3245 
3255 _MHD_EXTERN void
3256 MHD_destroy_response (struct MHD_Response *response);
3257 
3258 
3269 _MHD_EXTERN int
3270 MHD_add_response_header (struct MHD_Response *response,
3271  const char *header,
3272  const char *content);
3273 
3274 
3284 _MHD_EXTERN int
3285 MHD_add_response_footer (struct MHD_Response *response,
3286  const char *footer,
3287  const char *content);
3288 
3289 
3299 _MHD_EXTERN int
3300 MHD_del_response_header (struct MHD_Response *response,
3301  const char *header,
3302  const char *content);
3303 
3304 
3315 _MHD_EXTERN int
3316 MHD_get_response_headers (struct MHD_Response *response,
3317  MHD_KeyValueIterator iterator,
3318  void *iterator_cls);
3319 
3320 
3329 _MHD_EXTERN const char *
3330 MHD_get_response_header (struct MHD_Response *response,
3331  const char *key);
3332 
3333 
3334 /* ********************** PostProcessor functions ********************** */
3335 
3361 _MHD_EXTERN struct MHD_PostProcessor *
3362 MHD_create_post_processor (struct MHD_Connection *connection,
3363  size_t buffer_size,
3364  MHD_PostDataIterator iter, void *iter_cls);
3365 
3366 
3380 _MHD_EXTERN int
3381 MHD_post_process (struct MHD_PostProcessor *pp,
3382  const char *post_data, size_t post_data_len);
3383 
3384 
3395 _MHD_EXTERN int
3396 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
3397 
3398 
3399 /* ********************* Digest Authentication functions *************** */
3400 
3401 
3407 #define MHD_INVALID_NONCE -1
3408 
3409 
3418 _MHD_EXTERN char *
3419 MHD_digest_auth_get_username (struct MHD_Connection *connection);
3420 
3421 
3430 _MHD_EXTERN void
3431 MHD_free (void *ptr);
3432 
3433 
3438 
3443 
3448 
3453 
3454 };
3455 
3456 
3471 _MHD_EXTERN int
3472 MHD_digest_auth_check2 (struct MHD_Connection *connection,
3473  const char *realm,
3474  const char *username,
3475  const char *password,
3476  unsigned int nonce_timeout,
3477  enum MHD_DigestAuthAlgorithm algo);
3478 
3479 
3498 _MHD_EXTERN int
3499 MHD_digest_auth_check (struct MHD_Connection *connection,
3500  const char *realm,
3501  const char *username,
3502  const char *password,
3503  unsigned int nonce_timeout);
3504 
3505 
3523 _MHD_EXTERN int
3524 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3525  const char *realm,
3526  const char *username,
3527  const uint8_t *digest,
3528  size_t digest_size,
3529  unsigned int nonce_timeout,
3530  enum MHD_DigestAuthAlgorithm algo);
3531 
3532 
3551 _MHD_EXTERN int
3552 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3553  const char *realm,
3554  const char *username,
3555  const uint8_t digest[MHD_MD5_DIGEST_SIZE],
3556  unsigned int nonce_timeout);
3557 
3558 
3574 _MHD_EXTERN int
3575 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3576  const char *realm,
3577  const char *opaque,
3578  struct MHD_Response *response,
3579  int signal_stale,
3580  enum MHD_DigestAuthAlgorithm algo);
3581 
3582 
3600 _MHD_EXTERN int
3601 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3602  const char *realm,
3603  const char *opaque,
3604  struct MHD_Response *response,
3605  int signal_stale);
3606 
3607 
3617 _MHD_EXTERN char *
3619  char** password);
3620 
3621 
3634 _MHD_EXTERN int
3636  const char *realm,
3637  struct MHD_Response *response);
3638 
3639 /* ********************** generic query functions ********************** */
3640 
3641 
3652 _MHD_EXTERN const union MHD_ConnectionInfo *
3653 MHD_get_connection_info (struct MHD_Connection *connection,
3654  enum MHD_ConnectionInfoType info_type,
3655  ...);
3656 
3657 
3663 {
3664 
3673 
3674 };
3675 
3676 
3686 _MHD_EXTERN int
3687 MHD_set_connection_option (struct MHD_Connection *connection,
3688  enum MHD_CONNECTION_OPTION option,
3689  ...);
3690 
3691 
3696 {
3701  size_t key_size;
3702 
3708 
3713 
3717  uint16_t port;
3718 
3723 
3727  unsigned int num_connections;
3728 
3736 };
3737 
3738 
3750 _MHD_EXTERN const union MHD_DaemonInfo *
3751 MHD_get_daemon_info (struct MHD_Daemon *daemon,
3752  enum MHD_DaemonInfoType info_type,
3753  ...);
3754 
3755 
3762 _MHD_EXTERN const char*
3763 MHD_get_version (void);
3764 
3765 
3771 {
3777 
3787 
3793 
3799 
3807 
3813 
3820 
3827 
3833 
3840 
3847 
3855 
3863 
3870 
3880 
3886 
3893 
3906 
3912 
3919 
3926 
3931 };
3932 
3933 
3945 _MHD_EXTERN int
3946 MHD_is_feature_supported (enum MHD_FEATURE feature);
3947 
3948 
3949 #if 0 /* keep Emacsens' auto-indent happy */
3950 {
3951 #endif
3952 #ifdef __cplusplus
3953 }
3954 #endif
3955 
3956 #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:2163
_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:5559
_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:3707
_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:3712
void * data
Definition: microhttpd.h:2948
_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:2948
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:3371
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2257
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:3071
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:2280
_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:1734
_MHD_EXTERN int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
MHD_socket connect_fd
Definition: microhttpd.h:1841
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:4744
intptr_t value
Definition: microhttpd.h:1669
MHD_ConnectionNotificationCode
Definition: microhttpd.h:1792
_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:2033
_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:2885
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:4168
void * socket_context
Definition: internal.h:691
#define MHD_MD5_DIGEST_SIZE
Definition: microhttpd.h:305
MHD_CONNECTION_OPTION
Definition: microhttpd.h:3662
_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:3076
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:6662
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:3565
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2241
MHD_DigestAuthAlgorithm
Definition: microhttpd.h:3437
_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:2855
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:4225
void int must_free
Definition: microhttpd.h:2948
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:1684
struct MHD_Daemon * daemon
Definition: microhttpd.h:1867
_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:3082
MHD_FEATURE
Definition: microhttpd.h:3770
MHD_ConnectionInfoType
Definition: microhttpd.h:1882
_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:3076
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:4291
_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:1836
MHD_AcceptPolicyCallback apc
Definition: internal.h:1367
uint16_t port
Definition: microhttpd.h:3717
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:2092
_MHD_EXTERN struct MHD_Response * MHD_create_response_for_upgrade(MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls)
void * ptr_value
Definition: microhttpd.h:1675
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:2115
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:3203
_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:4590
MHD_OPTION
MHD options.
Definition: microhttpd.h:1321
enum MHD_FLAG flags
Definition: microhttpd.h:3735
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:2518
MHD_ContentReaderCallback crc
Definition: internal.h:1597
MHD_UpgradeAction
Definition: microhttpd.h:3116
_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:1968
_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:6941
struct sockaddr * client_addr
Definition: microhttpd.h:1861
_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:1108
MHD_ResponseFlags
Definition: microhttpd.h:2854
_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:4789
unsigned int num_connections
Definition: microhttpd.h:3727
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2047
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2141
_MHD_EXTERN const union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
Definition: daemon.c:6826
_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:1662
_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:1692
_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:2958
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:2884
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:2188