GNU libmicrohttpd  0.9.68
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 0x00096800
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 ( \
217  __LINE__) "): warning: " msg))
218 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
219 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
220 /* clang or GCC since 3.0 */
221 #define _MHD_GCC_PRAG(x) _Pragma (#x)
222 #if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \
223  (! defined(__apple_build_version__) && \
224  (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \
225  3))))) || \
226  __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8)
227 /* clang >= 3.3 (or XCode's clang >= 5.0) or
228  GCC >= 4.8 */
229 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg)
230 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
231 #else /* older clang or GCC */
232 /* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
233 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg)
234 #if (defined(__clang__) && (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == \
235  2 && __clang_minor__ >= \
236  9))) /* FIXME: clang >= 2.9, earlier versions not tested */
237 /* clang handles inline pragmas better than GCC */
238 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg)
239 #endif /* clang >= 2.9 */
240 #endif /* older clang or GCC */
241 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
242 #endif /* clang || GCC >= 3.0 */
243 #endif /* !_MHD_DEPR_MACRO */
244 
245 #ifndef _MHD_DEPR_MACRO
246 #define _MHD_DEPR_MACRO(msg)
247 #endif /* !_MHD_DEPR_MACRO */
248 
249 #ifndef _MHD_DEPR_IN_MACRO
250 #define _MHD_NO_DEPR_IN_MACRO 1
251 #define _MHD_DEPR_IN_MACRO(msg)
252 #endif /* !_MHD_DEPR_IN_MACRO */
253 
254 #ifndef _MHD_DEPR_FUNC
255 #if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400
256 /* VS 2005 or later */
257 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg))
258 #elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310
259 /* VS .NET 2003 deprecation do not support custom messages */
260 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
261 #elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \
262  (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \
263  9))) /* FIXME: earlier versions not tested */
264 /* GCC >= 5.0 or clang >= 2.9 */
265 #define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg)))
266 #elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \
267  __GNUC_MINOR__ + 0 >= 1)
268 /* 3.1 <= GCC < 5.0 or clang < 2.9 */
269 /* old GCC-style deprecation do not support custom messages */
270 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
271 /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
272 #endif /* clang < 2.9 || GCC >= 3.1 */
273 #endif /* !_MHD_DEPR_FUNC */
274 
275 #ifndef _MHD_DEPR_FUNC
276 #define _MHD_NO_DEPR_FUNC 1
277 #define _MHD_DEPR_FUNC(msg)
278 #endif /* !_MHD_DEPR_FUNC */
279 
285 #ifndef MHD_LONG_LONG
286 
289 #define MHD_LONG_LONG long long
290 #define MHD_UNSIGNED_LONG_LONG unsigned long long
291 #else /* MHD_LONG_LONG */
293  "Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
294 #endif
295 
299 #ifndef MHD_LONG_LONG_PRINTF
300 
303 #define MHD_LONG_LONG_PRINTF "ll"
304 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
305 #else /* MHD_LONG_LONG_PRINTF */
307  "Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
308 #endif
309 
310 
314 #define MHD_MD5_DIGEST_SIZE 16
315 
316 
325 /* 100 "Continue". RFC7231, Section 6.2.1. */
326 #define MHD_HTTP_CONTINUE 100
327 /* 101 "Switching Protocols". RFC7231, Section 6.2.2. */
328 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
329 /* 102 "Processing". RFC2518. */
330 #define MHD_HTTP_PROCESSING 102
331 /* 103 "Early Hints". RFC8297. */
332 #define MHD_HTTP_EARLY_HINTS 103
333 
334 /* 200 "OK". RFC7231, Section 6.3.1. */
335 #define MHD_HTTP_OK 200
336 /* 201 "Created". RFC7231, Section 6.3.2. */
337 #define MHD_HTTP_CREATED 201
338 /* 202 "Accepted". RFC7231, Section 6.3.3. */
339 #define MHD_HTTP_ACCEPTED 202
340 /* 203 "Non-Authoritative Information". RFC7231, Section 6.3.4. */
341 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
342 /* 204 "No Content". RFC7231, Section 6.3.5. */
343 #define MHD_HTTP_NO_CONTENT 204
344 /* 205 "Reset Content". RFC7231, Section 6.3.6. */
345 #define MHD_HTTP_RESET_CONTENT 205
346 /* 206 "Partial Content". RFC7233, Section 4.1. */
347 #define MHD_HTTP_PARTIAL_CONTENT 206
348 /* 207 "Multi-Status". RFC4918. */
349 #define MHD_HTTP_MULTI_STATUS 207
350 /* 208 "Already Reported". RFC5842. */
351 #define MHD_HTTP_ALREADY_REPORTED 208
352 
353 /* 226 "IM Used". RFC3229. */
354 #define MHD_HTTP_IM_USED 226
355 
356 /* 300 "Multiple Choices". RFC7231, Section 6.4.1. */
357 #define MHD_HTTP_MULTIPLE_CHOICES 300
358 /* 301 "Moved Permanently". RFC7231, Section 6.4.2. */
359 #define MHD_HTTP_MOVED_PERMANENTLY 301
360 /* 302 "Found". RFC7231, Section 6.4.3. */
361 #define MHD_HTTP_FOUND 302
362 /* 303 "See Other". RFC7231, Section 6.4.4. */
363 #define MHD_HTTP_SEE_OTHER 303
364 /* 304 "Not Modified". RFC7232, Section 4.1. */
365 #define MHD_HTTP_NOT_MODIFIED 304
366 /* 305 "Use Proxy". RFC7231, Section 6.4.5. */
367 #define MHD_HTTP_USE_PROXY 305
368 /* 306 "Switch Proxy". Not used! RFC7231, Section 6.4.6. */
369 #define MHD_HTTP_SWITCH_PROXY 306
370 /* 307 "Temporary Redirect". RFC7231, Section 6.4.7. */
371 #define MHD_HTTP_TEMPORARY_REDIRECT 307
372 /* 308 "Permanent Redirect". RFC7538. */
373 #define MHD_HTTP_PERMANENT_REDIRECT 308
374 
375 /* 400 "Bad Request". RFC7231, Section 6.5.1. */
376 #define MHD_HTTP_BAD_REQUEST 400
377 /* 401 "Unauthorized". RFC7235, Section 3.1. */
378 #define MHD_HTTP_UNAUTHORIZED 401
379 /* 402 "Payment Required". RFC7231, Section 6.5.2. */
380 #define MHD_HTTP_PAYMENT_REQUIRED 402
381 /* 403 "Forbidden". RFC7231, Section 6.5.3. */
382 #define MHD_HTTP_FORBIDDEN 403
383 /* 404 "Not Found". RFC7231, Section 6.5.4. */
384 #define MHD_HTTP_NOT_FOUND 404
385 /* 405 "Method Not Allowed". RFC7231, Section 6.5.5. */
386 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
387 /* 406 "Not Acceptable". RFC7231, Section 6.5.6. */
388 #define MHD_HTTP_NOT_ACCEPTABLE 406
389 /* 407 "Proxy Authentication Required". RFC7235, Section 3.2. */
390 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
391 /* 408 "Request Timeout". RFC7231, Section 6.5.7. */
392 #define MHD_HTTP_REQUEST_TIMEOUT 408
393 /* 409 "Conflict". RFC7231, Section 6.5.8. */
394 #define MHD_HTTP_CONFLICT 409
395 /* 410 "Gone". RFC7231, Section 6.5.9. */
396 #define MHD_HTTP_GONE 410
397 /* 411 "Length Required". RFC7231, Section 6.5.10. */
398 #define MHD_HTTP_LENGTH_REQUIRED 411
399 /* 412 "Precondition Failed". RFC7232, Section 4.2; RFC8144, Section 3.2. */
400 #define MHD_HTTP_PRECONDITION_FAILED 412
401 /* 413 "Payload Too Large". RFC7231, Section 6.5.11. */
402 #define MHD_HTTP_PAYLOAD_TOO_LARGE 413
403 /* 414 "URI Too Long". RFC7231, Section 6.5.12. */
404 #define MHD_HTTP_URI_TOO_LONG 414
405 /* 415 "Unsupported Media Type". RFC7231, Section 6.5.13; RFC7694, Section 3. */
406 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
407 /* 416 "Range Not Satisfiable". RFC7233, Section 4.4. */
408 #define MHD_HTTP_RANGE_NOT_SATISFIABLE 416
409 /* 417 "Expectation Failed". RFC7231, Section 6.5.14. */
410 #define MHD_HTTP_EXPECTATION_FAILED 417
411 
412 /* 421 "Misdirected Request". RFC7540, Section 9.1.2. */
413 #define MHD_HTTP_MISDIRECTED_REQUEST 421
414 /* 422 "Unprocessable Entity". RFC4918. */
415 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
416 /* 423 "Locked". RFC4918. */
417 #define MHD_HTTP_LOCKED 423
418 /* 424 "Failed Dependency". RFC4918. */
419 #define MHD_HTTP_FAILED_DEPENDENCY 424
420 /* 425 "Too Early". RFC8470. */
421 #define MHD_HTTP_TOO_EARLY 425
422 /* 426 "Upgrade Required". RFC7231, Section 6.5.15. */
423 #define MHD_HTTP_UPGRADE_REQUIRED 426
424 
425 /* 428 "Precondition Required". RFC6585. */
426 #define MHD_HTTP_PRECONDITION_REQUIRED 428
427 /* 429 "Too Many Requests". RFC6585. */
428 #define MHD_HTTP_TOO_MANY_REQUESTS 429
429 
430 /* 431 "Request Header Fields Too Large". RFC6585. */
431 #define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
432 
433 /* 451 "Unavailable For Legal Reasons". RFC7725. */
434 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
435 
436 /* 500 "Internal Server Error". RFC7231, Section 6.6.1. */
437 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
438 /* 501 "Not Implemented". RFC7231, Section 6.6.2. */
439 #define MHD_HTTP_NOT_IMPLEMENTED 501
440 /* 502 "Bad Gateway". RFC7231, Section 6.6.3. */
441 #define MHD_HTTP_BAD_GATEWAY 502
442 /* 503 "Service Unavailable". RFC7231, Section 6.6.4. */
443 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
444 /* 504 "Gateway Timeout". RFC7231, Section 6.6.5. */
445 #define MHD_HTTP_GATEWAY_TIMEOUT 504
446 /* 505 "HTTP Version Not Supported". RFC7231, Section 6.6.6. */
447 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
448 /* 506 "Variant Also Negotiates". RFC2295. */
449 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
450 /* 507 "Insufficient Storage". RFC4918. */
451 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
452 /* 508 "Loop Detected". RFC5842. */
453 #define MHD_HTTP_LOOP_DETECTED 508
454 
455 /* 510 "Not Extended". RFC2774. */
456 #define MHD_HTTP_NOT_EXTENDED 510
457 /* 511 "Network Authentication Required". RFC6585. */
458 #define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
459 
460 
461 /* Not registered non-standard codes */
462 /* 449 "Reply With". MS IIS extension. */
463 #define MHD_HTTP_RETRY_WITH 449
464 
465 /* 450 "Blocked by Windows Parental Controls". MS extension. */
466 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
467 
468 /* 509 "Bandwidth Limit Exceeded". Apache extension. */
469 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
470 
471 
472 /* Deprecated codes */
474 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
475  _MHD_DEPR_IN_MACRO ( \
476  "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") \
477  406
478 
480 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
481  _MHD_DEPR_IN_MACRO ( \
482  "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") \
483  413
484 
486 #define MHD_HTTP_REQUEST_URI_TOO_LONG \
487  _MHD_DEPR_IN_MACRO ( \
488  "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") \
489  414
490 
492 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
493  _MHD_DEPR_IN_MACRO ( \
494  "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") \
495  416
496 
498 #define MHD_HTTP_UNORDERED_COLLECTION \
499  _MHD_DEPR_IN_MACRO ( \
500  "Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") \
501  425
502 
504 #define MHD_HTTP_NO_RESPONSE \
505  _MHD_DEPR_IN_MACRO ( \
506  "Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for logs only") \
507  444
508 
509  /* end of group httpcode */
511 
518 _MHD_EXTERN const char *
519 MHD_get_reason_phrase_for (unsigned int code);
520 
521 
528 #define MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31))
529 
538 /* Main HTTP headers. */
539 /* Standard. RFC7231, Section 5.3.2 */
540 #define MHD_HTTP_HEADER_ACCEPT "Accept"
541 /* Standard. RFC7231, Section 5.3.3 */
542 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
543 /* Standard. RFC7231, Section 5.3.4; RFC7694, Section 3 */
544 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
545 /* Standard. RFC7231, Section 5.3.5 */
546 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
547 /* Standard. RFC7233, Section 2.3 */
548 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
549 /* Standard. RFC7234, Section 5.1 */
550 #define MHD_HTTP_HEADER_AGE "Age"
551 /* Standard. RFC7231, Section 7.4.1 */
552 #define MHD_HTTP_HEADER_ALLOW "Allow"
553 /* Standard. RFC7235, Section 4.2 */
554 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
555 /* Standard. RFC7234, Section 5.2 */
556 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
557 /* Reserved. RFC7230, Section 8.1 */
558 #define MHD_HTTP_HEADER_CLOSE "Close"
559 /* Standard. RFC7230, Section 6.1 */
560 #define MHD_HTTP_HEADER_CONNECTION "Connection"
561 /* Standard. RFC7231, Section 3.1.2.2 */
562 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
563 /* Standard. RFC7231, Section 3.1.3.2 */
564 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
565 /* Standard. RFC7230, Section 3.3.2 */
566 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
567 /* Standard. RFC7231, Section 3.1.4.2 */
568 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
569 /* Standard. RFC7233, Section 4.2 */
570 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
571 /* Standard. RFC7231, Section 3.1.1.5 */
572 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
573 /* Standard. RFC7231, Section 7.1.1.2 */
574 #define MHD_HTTP_HEADER_DATE "Date"
575 /* Standard. RFC7232, Section 2.3 */
576 #define MHD_HTTP_HEADER_ETAG "ETag"
577 /* Standard. RFC7231, Section 5.1.1 */
578 #define MHD_HTTP_HEADER_EXPECT "Expect"
579 /* Standard. RFC7234, Section 5.3 */
580 #define MHD_HTTP_HEADER_EXPIRES "Expires"
581 /* Standard. RFC7231, Section 5.5.1 */
582 #define MHD_HTTP_HEADER_FROM "From"
583 /* Standard. RFC7230, Section 5.4 */
584 #define MHD_HTTP_HEADER_HOST "Host"
585 /* Standard. RFC7232, Section 3.1 */
586 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
587 /* Standard. RFC7232, Section 3.3 */
588 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
589 /* Standard. RFC7232, Section 3.2 */
590 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
591 /* Standard. RFC7233, Section 3.2 */
592 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
593 /* Standard. RFC7232, Section 3.4 */
594 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
595 /* Standard. RFC7232, Section 2.2 */
596 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
597 /* Standard. RFC7231, Section 7.1.2 */
598 #define MHD_HTTP_HEADER_LOCATION "Location"
599 /* Standard. RFC7231, Section 5.1.2 */
600 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
601 /* Standard. RFC7231, Appendix A.1 */
602 #define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version"
603 /* Standard. RFC7234, Section 5.4 */
604 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
605 /* Standard. RFC7235, Section 4.3 */
606 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
607 /* Standard. RFC7235, Section 4.4 */
608 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
609 /* Standard. RFC7233, Section 3.1 */
610 #define MHD_HTTP_HEADER_RANGE "Range"
611 /* Standard. RFC7231, Section 5.5.2 */
612 #define MHD_HTTP_HEADER_REFERER "Referer"
613 /* Standard. RFC7231, Section 7.1.3 */
614 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
615 /* Standard. RFC7231, Section 7.4.2 */
616 #define MHD_HTTP_HEADER_SERVER "Server"
617 /* Standard. RFC7230, Section 4.3 */
618 #define MHD_HTTP_HEADER_TE "TE"
619 /* Standard. RFC7230, Section 4.4 */
620 #define MHD_HTTP_HEADER_TRAILER "Trailer"
621 /* Standard. RFC7230, Section 3.3.1 */
622 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
623 /* Standard. RFC7230, Section 6.7 */
624 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
625 /* Standard. RFC7231, Section 5.5.3 */
626 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
627 /* Standard. RFC7231, Section 7.1.4 */
628 #define MHD_HTTP_HEADER_VARY "Vary"
629 /* Standard. RFC7230, Section 5.7.1 */
630 #define MHD_HTTP_HEADER_VIA "Via"
631 /* Standard. RFC7235, Section 4.1 */
632 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
633 /* Standard. RFC7234, Section 5.5 */
634 #define MHD_HTTP_HEADER_WARNING "Warning"
635 
636 /* Additional HTTP headers. */
637 /* No category. RFC4229 */
638 #define MHD_HTTP_HEADER_A_IM "A-IM"
639 /* No category. RFC4229 */
640 #define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions"
641 /* Informational. RFC7089 */
642 #define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime"
643 /* No category. RFC4229 */
644 #define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features"
645 /* No category. RFC5789 */
646 #define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch"
647 /* Standard. https://www.w3.org/TR/ldp/ */
648 #define MHD_HTTP_HEADER_ACCEPT_POST "Accept-Post"
649 /* Standard. RFC7639, Section 2 */
650 #define MHD_HTTP_HEADER_ALPN "ALPN"
651 /* Standard. RFC7838 */
652 #define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc"
653 /* Standard. RFC7838 */
654 #define MHD_HTTP_HEADER_ALT_USED "Alt-Used"
655 /* No category. RFC4229 */
656 #define MHD_HTTP_HEADER_ALTERNATES "Alternates"
657 /* No category. RFC4437 */
658 #define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref"
659 /* Experimental. RFC8053, Section 4 */
660 #define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control"
661 /* Standard. RFC7615, Section 3 */
662 #define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info"
663 /* No category. RFC4229 */
664 #define MHD_HTTP_HEADER_C_EXT "C-Ext"
665 /* No category. RFC4229 */
666 #define MHD_HTTP_HEADER_C_MAN "C-Man"
667 /* No category. RFC4229 */
668 #define MHD_HTTP_HEADER_C_OPT "C-Opt"
669 /* No category. RFC4229 */
670 #define MHD_HTTP_HEADER_C_PEP "C-PEP"
671 /* No category. RFC4229 */
672 #define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info"
673 /* Standard. RFC8607, Section 5.1 */
674 #define MHD_HTTP_HEADER_CAL_MANAGED_ID "Cal-Managed-ID"
675 /* Standard. RFC7809, Section 7.1 */
676 #define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
677 /* Standard. RFC8586 */
678 #define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop"
679 /* Obsoleted. RFC2068; RFC2616 */
680 #define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
681 /* Standard. RFC6266 */
682 #define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition"
683 /* No category. RFC4229 */
684 #define MHD_HTTP_HEADER_CONTENT_ID "Content-ID"
685 /* No category. RFC4229 */
686 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
687 /* No category. RFC4229 */
688 #define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type"
689 /* No category. RFC4229 */
690 #define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type"
691 /* No category. RFC4229 */
692 #define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version"
693 /* Standard. RFC6265 */
694 #define MHD_HTTP_HEADER_COOKIE "Cookie"
695 /* Obsoleted. RFC2965; RFC6265 */
696 #define MHD_HTTP_HEADER_COOKIE2 "Cookie2"
697 /* Standard. RFC5323 */
698 #define MHD_HTTP_HEADER_DASL "DASL"
699 /* Standard. RFC4918 */
700 #define MHD_HTTP_HEADER_DAV "DAV"
701 /* No category. RFC4229 */
702 #define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style"
703 /* No category. RFC4229 */
704 #define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base"
705 /* Standard. RFC4918 */
706 #define MHD_HTTP_HEADER_DEPTH "Depth"
707 /* No category. RFC4229 */
708 #define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From"
709 /* Standard. RFC4918 */
710 #define MHD_HTTP_HEADER_DESTINATION "Destination"
711 /* No category. RFC4229 */
712 #define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID"
713 /* No category. RFC4229 */
714 #define MHD_HTTP_HEADER_DIGEST "Digest"
715 /* Standard. RFC8470 */
716 #define MHD_HTTP_HEADER_EARLY_DATA "Early-Data"
717 /* Experimental. RFC-ietf-httpbis-expect-ct-08 */
718 #define MHD_HTTP_HEADER_EXPECT_CT "Expect-CT"
719 /* No category. RFC4229 */
720 #define MHD_HTTP_HEADER_EXT "Ext"
721 /* Standard. RFC7239 */
722 #define MHD_HTTP_HEADER_FORWARDED "Forwarded"
723 /* No category. RFC4229 */
724 #define MHD_HTTP_HEADER_GETPROFILE "GetProfile"
725 /* Experimental. RFC7486, Section 6.1.1 */
726 #define MHD_HTTP_HEADER_HOBAREG "Hobareg"
727 /* Standard. RFC7540, Section 3.2.1 */
728 #define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings"
729 /* No category. RFC4229 */
730 #define MHD_HTTP_HEADER_IM "IM"
731 /* Standard. RFC4918 */
732 #define MHD_HTTP_HEADER_IF "If"
733 /* Standard. RFC6638 */
734 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
735 /* Standard. RFC8473 */
736 #define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID \
737  "Include-Referred-Token-Binding-ID"
738 /* No category. RFC4229 */
739 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
740 /* No category. RFC4229 */
741 #define MHD_HTTP_HEADER_LABEL "Label"
742 /* Standard. RFC8288 */
743 #define MHD_HTTP_HEADER_LINK "Link"
744 /* Standard. RFC4918 */
745 #define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token"
746 /* No category. RFC4229 */
747 #define MHD_HTTP_HEADER_MAN "Man"
748 /* Informational. RFC7089 */
749 #define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime"
750 /* No category. RFC4229 */
751 #define MHD_HTTP_HEADER_METER "Meter"
752 /* No category. RFC4229 */
753 #define MHD_HTTP_HEADER_NEGOTIATE "Negotiate"
754 /* No category. RFC4229 */
755 #define MHD_HTTP_HEADER_OPT "Opt"
756 /* Experimental. RFC8053, Section 3 */
757 #define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate"
758 /* Standard. RFC4229 */
759 #define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
760 /* Standard. RFC6454 */
761 #define MHD_HTTP_HEADER_ORIGIN "Origin"
762 /* Standard. RFC-ietf-core-object-security-16, Section 11.1 */
763 #define MHD_HTTP_HEADER_OSCORE "OSCORE"
764 /* Standard. RFC4918 */
765 #define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
766 /* No category. RFC4229 */
767 #define MHD_HTTP_HEADER_P3P "P3P"
768 /* No category. RFC4229 */
769 #define MHD_HTTP_HEADER_PEP "PEP"
770 /* No category. RFC4229 */
771 #define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label"
772 /* No category. RFC4229 */
773 #define MHD_HTTP_HEADER_PEP_INFO "Pep-Info"
774 /* Standard. RFC4229 */
775 #define MHD_HTTP_HEADER_POSITION "Position"
776 /* Standard. RFC7240 */
777 #define MHD_HTTP_HEADER_PREFER "Prefer"
778 /* Standard. RFC7240 */
779 #define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied"
780 /* No category. RFC4229 */
781 #define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject"
782 /* No category. RFC4229 */
783 #define MHD_HTTP_HEADER_PROTOCOL "Protocol"
784 /* No category. RFC4229 */
785 #define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info"
786 /* No category. RFC4229 */
787 #define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query"
788 /* No category. RFC4229 */
789 #define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request"
790 /* Standard. RFC7615, Section 4 */
791 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info"
792 /* No category. RFC4229 */
793 #define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features"
794 /* No category. RFC4229 */
795 #define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction"
796 /* No category. RFC4229 */
797 #define MHD_HTTP_HEADER_PUBLIC "Public"
798 /* Standard. RFC7469 */
799 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
800 /* Standard. RFC7469 */
801 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \
802  "Public-Key-Pins-Report-Only"
803 /* No category. RFC4437 */
804 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
805 /* Standard. RFC8555, Section 6.5.1 */
806 #define MHD_HTTP_HEADER_REPLAY_NONCE "Replay-Nonce"
807 /* No category. RFC4229 */
808 #define MHD_HTTP_HEADER_SAFE "Safe"
809 /* Standard. RFC6638 */
810 #define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply"
811 /* Standard. RFC6638 */
812 #define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag"
813 /* Standard. RFC8473 */
814 #define MHD_HTTP_HEADER_SEC_TOKEN_BINDING "Sec-Token-Binding"
815 /* Standard. RFC6455 */
816 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept"
817 /* Standard. RFC6455 */
818 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions"
819 /* Standard. RFC6455 */
820 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key"
821 /* Standard. RFC6455 */
822 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol"
823 /* Standard. RFC6455 */
824 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version"
825 /* No category. RFC4229 */
826 #define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme"
827 /* Standard. RFC6265 */
828 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
829 /* Obsoleted. RFC2965; RFC6265 */
830 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
831 /* No category. RFC4229 */
832 #define MHD_HTTP_HEADER_SETPROFILE "SetProfile"
833 /* Standard. RFC5023 */
834 #define MHD_HTTP_HEADER_SLUG "SLUG"
835 /* No category. RFC4229 */
836 #define MHD_HTTP_HEADER_SOAPACTION "SoapAction"
837 /* No category. RFC4229 */
838 #define MHD_HTTP_HEADER_STATUS_URI "Status-URI"
839 /* Standard. RFC6797 */
840 #define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security"
841 /* Informational. RFC8594 */
842 #define MHD_HTTP_HEADER_SUNSET "Sunset"
843 /* No category. RFC4229 */
844 #define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability"
845 /* No category. RFC4229 */
846 #define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control"
847 /* No category. RFC4229 */
848 #define MHD_HTTP_HEADER_TCN "TCN"
849 /* Standard. RFC4918 */
850 #define MHD_HTTP_HEADER_TIMEOUT "Timeout"
851 /* Standard. RFC8030, Section 5.4 */
852 #define MHD_HTTP_HEADER_TOPIC "Topic"
853 /* Standard. RFC8030, Section 5.2 */
854 #define MHD_HTTP_HEADER_TTL "TTL"
855 /* Standard. RFC8030, Section 5.3 */
856 #define MHD_HTTP_HEADER_URGENCY "Urgency"
857 /* No category. RFC4229 */
858 #define MHD_HTTP_HEADER_URI "URI"
859 /* No category. RFC4229 */
860 #define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary"
861 /* No category. RFC4229 */
862 #define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest"
863 /* Standard. https://fetch.spec.whatwg.org/#x-content-type-options-header */
864 #define MHD_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS "X-Content-Type-Options"
865 /* Informational. RFC7034 */
866 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
867 
868 /* Some provisional headers. */
869 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \
870  "Access-Control-Allow-Origin"
871  /* end of group headers */
872 
879 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
880 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
881  /* end of group versions */
883 
892 /* Main HTTP methods. */
893 /* Not safe. Not idempotent. RFC7231, Section 4.3.6. */
894 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
895 /* Not safe. Idempotent. RFC7231, Section 4.3.5. */
896 #define MHD_HTTP_METHOD_DELETE "DELETE"
897 /* Safe. Idempotent. RFC7231, Section 4.3.1. */
898 #define MHD_HTTP_METHOD_GET "GET"
899 /* Safe. Idempotent. RFC7231, Section 4.3.2. */
900 #define MHD_HTTP_METHOD_HEAD "HEAD"
901 /* Safe. Idempotent. RFC7231, Section 4.3.7. */
902 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
903 /* Not safe. Not idempotent. RFC7231, Section 4.3.3. */
904 #define MHD_HTTP_METHOD_POST "POST"
905 /* Not safe. Idempotent. RFC7231, Section 4.3.4. */
906 #define MHD_HTTP_METHOD_PUT "PUT"
907 /* Safe. Idempotent. RFC7231, Section 4.3.8. */
908 #define MHD_HTTP_METHOD_TRACE "TRACE"
909 
910 /* Additional HTTP methods. */
911 /* Not safe. Idempotent. RFC3744, Section 8.1. */
912 #define MHD_HTTP_METHOD_ACL "ACL"
913 /* Not safe. Idempotent. RFC3253, Section 12.6. */
914 #define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL"
915 /* Not safe. Idempotent. RFC5842, Section 4. */
916 #define MHD_HTTP_METHOD_BIND "BIND"
917 /* Not safe. Idempotent. RFC3253, Section 4.4, Section 9.4. */
918 #define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
919 /* Not safe. Idempotent. RFC3253, Section 4.3, Section 8.8. */
920 #define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
921 /* Not safe. Idempotent. RFC4918, Section 9.8. */
922 #define MHD_HTTP_METHOD_COPY "COPY"
923 /* Not safe. Idempotent. RFC3253, Section 8.2. */
924 #define MHD_HTTP_METHOD_LABEL "LABEL"
925 /* Not safe. Idempotent. RFC2068, Section 19.6.1.2. */
926 #define MHD_HTTP_METHOD_LINK "LINK"
927 /* Not safe. Not idempotent. RFC4918, Section 9.10. */
928 #define MHD_HTTP_METHOD_LOCK "LOCK"
929 /* Not safe. Idempotent. RFC3253, Section 11.2. */
930 #define MHD_HTTP_METHOD_MERGE "MERGE"
931 /* Not safe. Idempotent. RFC3253, Section 13.5. */
932 #define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
933 /* Not safe. Idempotent. RFC4791, Section 5.3.1; RFC8144, Section 2.3. */
934 #define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
935 /* Not safe. Idempotent. RFC4918, Section 9.3; RFC5689, Section 3; RFC8144, Section 2.3. */
936 #define MHD_HTTP_METHOD_MKCOL "MKCOL"
937 /* Not safe. Idempotent. RFC4437, Section 6. */
938 #define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
939 /* Not safe. Idempotent. RFC3253, Section 6.3. */
940 #define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
941 /* Not safe. Idempotent. RFC4918, Section 9.9. */
942 #define MHD_HTTP_METHOD_MOVE "MOVE"
943 /* Not safe. Idempotent. RFC3648, Section 7. */
944 #define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
945 /* Not safe. Not idempotent. RFC5789, Section 2. */
946 #define MHD_HTTP_METHOD_PATCH "PATCH"
947 /* Safe. Idempotent. RFC7540, Section 3.5. */
948 #define MHD_HTTP_METHOD_PRI "PRI"
949 /* Safe. Idempotent. RFC4918, Section 9.1; RFC8144, Section 2.1. */
950 #define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
951 /* Not safe. Idempotent. RFC4918, Section 9.2; RFC8144, Section 2.2. */
952 #define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
953 /* Not safe. Idempotent. RFC5842, Section 6. */
954 #define MHD_HTTP_METHOD_REBIND "REBIND"
955 /* Safe. Idempotent. RFC3253, Section 3.6; RFC8144, Section 2.1. */
956 #define MHD_HTTP_METHOD_REPORT "REPORT"
957 /* Safe. Idempotent. RFC5323, Section 2. */
958 #define MHD_HTTP_METHOD_SEARCH "SEARCH"
959 /* Not safe. Idempotent. RFC5842, Section 5. */
960 #define MHD_HTTP_METHOD_UNBIND "UNBIND"
961 /* Not safe. Idempotent. RFC3253, Section 4.5. */
962 #define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
963 /* Not safe. Idempotent. RFC2068, Section 19.6.1.3. */
964 #define MHD_HTTP_METHOD_UNLINK "UNLINK"
965 /* Not safe. Idempotent. RFC4918, Section 9.11. */
966 #define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
967 /* Not safe. Idempotent. RFC3253, Section 7.1. */
968 #define MHD_HTTP_METHOD_UPDATE "UPDATE"
969 /* Not safe. Idempotent. RFC4437, Section 7. */
970 #define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF"
971 /* Not safe. Idempotent. RFC3253, Section 3.5. */
972 #define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL"
973  /* end of group methods */
975 
981 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \
982  "application/x-www-form-urlencoded"
983 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
984  /* end of group postenc */
986 
987 
992 struct MHD_Daemon;
993 
1002 struct MHD_Connection;
1003 
1008 struct MHD_Response;
1009 
1014 struct MHD_PostProcessor;
1015 
1016 
1030 {
1035 
1042 
1048 
1053 
1056 #if 0
1057  /* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */
1058 #define MHD_USE_SSL \
1059  _MHD_DEPR_IN_MACRO ("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
1060  MHD_USE_TLS
1061 #endif
1062 
1068 
1079 
1082 #if 0 /* Will be marked for real deprecation later. */
1083 #define MHD_USE_SELECT_INTERNALLY \
1084  _MHD_DEPR_IN_MACRO ( \
1085  "Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \
1086  MHD_USE_INTERNAL_POLLING_THREAD
1087 #endif /* 0 */
1088 
1097 
1108 #if 0 /* Will be marked for real deprecation later. */
1109 #define MHD_USE_PEDANTIC_CHECKS \
1110  _MHD_DEPR_IN_MACRO ( \
1111  "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \
1112  32
1113 #endif /* 0 */
1114 
1124 
1130 
1133 #if 0 /* Will be marked for real deprecation later. */
1134 #define MHD_USE_POLL_INTERNALLY \
1135  _MHD_DEPR_IN_MACRO ( \
1136  "Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \
1137  MHD_USE_POLL_INTERNAL_THREAD
1138 #endif /* 0 */
1139 
1147 
1150 #if 0 /* Will be marked for real deprecation later. */
1151 #define MHD_SUPPRESS_DATE_NO_CLOCK \
1152  _MHD_DEPR_IN_MACRO ( \
1153  "Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
1154  MHD_USE_SUPPRESS_DATE_NO_CLOCK
1155 #endif /* 0 */
1156 
1165 
1174 
1177 #if 0 /* Will be marked for real deprecation later. */
1178 #define MHD_USE_EPOLL_LINUX_ONLY \
1179  _MHD_DEPR_IN_MACRO ( \
1180  "Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
1181  MHD_USE_EPOLL
1182 #endif /* 0 */
1183 
1192 
1198 #if 0 /* Will be marked for real deprecation later. */
1199 #define MHD_USE_EPOLL_INTERNALLY \
1200  _MHD_DEPR_IN_MACRO ( \
1201  "Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1202  MHD_USE_EPOLL_INTERNAL_THREAD
1203 
1204 #define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \
1205  _MHD_DEPR_IN_MACRO ( \
1206  "Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1207  MHD_USE_EPOLL_INTERNAL_THREAD
1208 #endif /* 0 */
1209 
1222  MHD_USE_ITC = 1024,
1223 
1226 #if 0 /* Will be marked for real deprecation later. */
1227 #define MHD_USE_PIPE_FOR_SHUTDOWN \
1228  _MHD_DEPR_IN_MACRO ( \
1229  "Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
1230  MHD_USE_ITC
1231 #endif /* 0 */
1232 
1237 
1245 
1248 #if 0 /* Will be marked for real deprecation later. */
1249 #define MHD_USE_EPOLL_TURBO \
1250  _MHD_DEPR_IN_MACRO ( \
1251  "Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
1252  MHD_USE_TURBO
1253 #endif /* 0 */
1254 
1260 
1263 #if 0 /* Will be marked for real deprecation later. */
1264 #define MHD_USE_SUSPEND_RESUME \
1265  _MHD_DEPR_IN_MACRO ( \
1266  "Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \
1267  MHD_ALLOW_SUSPEND_RESUME
1268 #endif /* 0 */
1269 
1276 
1283 
1295  MHD_USE_AUTO = 65536,
1296 
1304 
1310 
1316 
1317 };
1318 
1319 
1328 typedef void
1329 (*MHD_LogCallback)(void *cls,
1330  const char *fm,
1331  va_list ap);
1332 
1333 
1346 typedef int
1348  const struct MHD_Connection *connection,
1349  const char *username,
1350  void **psk,
1351  size_t *psk_size);
1352 
1359 {
1360 
1366 
1375 
1381 
1388 
1402 
1414 
1422 
1454 
1462 
1470 
1477 
1483 
1491 
1504 
1514 
1535 
1557 
1568 
1575 
1581 
1588 
1594 
1610 
1619 
1626 
1635 
1644 
1655 
1663 
1679 
1687 
1698 
1709 };
1710 
1711 
1717 {
1722 
1723 };
1724 
1725 
1730 {
1736 
1742  intptr_t value;
1743 
1748  void *ptr_value;
1749 
1750 };
1751 
1752 
1758 {
1759 
1765 #define MHD_RESPONSE_HEADER_KIND \
1766  _MHD_DEPR_IN_MACRO ( \
1767  "Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
1768  MHD_RESPONSE_HEADER_KIND
1769 
1774 
1780 
1790 
1795 
1800 };
1801 
1802 
1809 {
1810 
1816 
1824 
1832 
1839 
1849 
1857 
1858 };
1859 
1860 
1867 {
1868 
1874 
1880 
1881 };
1882 
1883 
1888 {
1889 
1893  int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
1894 
1898  int /* enum gnutls_protocol */ protocol;
1899 
1903  int /* MHD_YES or MHD_NO */ suspended;
1904 
1910  unsigned int connection_timeout;
1911 
1916 
1920  size_t header_size;
1921 
1925  void * /* gnutls_session_t */ tls_session;
1926 
1930  void * /* gnutls_x509_crt_t */ client_cert;
1931 
1935  struct sockaddr *client_addr;
1936 
1942 
1948 };
1949 
1950 
1957 {
1964 
1971 
1980 
1986 
1994 
2000 
2007 
2017 
2023 
2029 
2035 };
2036 
2037 
2043 {
2048 
2053 
2059 
2068 
2077 
2085 
2093 };
2094 
2095 
2106 typedef void
2107 (*MHD_PanicCallback) (void *cls,
2108  const char *file,
2109  unsigned int line,
2110  const char *reason);
2111 
2120 typedef int
2122  const struct sockaddr *addr,
2123  socklen_t addrlen);
2124 
2125 
2165 typedef int
2167  struct MHD_Connection *connection,
2168  const char *url,
2169  const char *method,
2170  const char *version,
2171  const char *upload_data,
2172  size_t *upload_data_size,
2173  void **con_cls);
2174 
2175 
2188 typedef void
2190  struct MHD_Connection *connection,
2191  void **con_cls,
2192  enum MHD_RequestTerminationCode toe);
2193 
2194 
2214 typedef void
2216  struct MHD_Connection *connection,
2217  void **socket_context,
2219 
2220 
2236 typedef int
2237 (*MHD_KeyValueIterator) (void *cls,
2238  enum MHD_ValueKind kind,
2239  const char *key,
2240  const char *value);
2241 
2242 
2261 typedef int
2263  enum MHD_ValueKind kind,
2264  const char *key,
2265  size_t key_size,
2266  const char *value,
2267  size_t value_size);
2268 
2269 
2314 typedef ssize_t
2316  uint64_t pos,
2317  char *buf,
2318  size_t max);
2319 
2320 
2330 typedef void
2332 
2333 
2353 typedef int
2354 (*MHD_PostDataIterator) (void *cls,
2355  enum MHD_ValueKind kind,
2356  const char *key,
2357  const char *filename,
2358  const char *content_type,
2359  const char *transfer_encoding,
2360  const char *data,
2361  uint64_t off,
2362  size_t size);
2363 
2364 /* **************** Daemon handling functions ***************** */
2365 
2387 _MHD_EXTERN struct MHD_Daemon *
2388 MHD_start_daemon_va (unsigned int flags,
2389  uint16_t port,
2391  MHD_AccessHandlerCallback dh, void *dh_cls,
2392  va_list ap);
2393 
2394 
2415 _MHD_EXTERN struct MHD_Daemon *
2416 MHD_start_daemon (unsigned int flags,
2417  uint16_t port,
2419  MHD_AccessHandlerCallback dh, void *dh_cls,
2420  ...);
2421 
2422 
2443 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
2444 
2445 
2452 _MHD_EXTERN void
2453 MHD_stop_daemon (struct MHD_Daemon *daemon);
2454 
2455 
2483 _MHD_EXTERN int
2484 MHD_add_connection (struct MHD_Daemon *daemon,
2485  MHD_socket client_socket,
2486  const struct sockaddr *addr,
2487  socklen_t addrlen);
2488 
2489 
2519 _MHD_EXTERN int
2520 MHD_get_fdset (struct MHD_Daemon *daemon,
2521  fd_set *read_fd_set,
2522  fd_set *write_fd_set,
2523  fd_set *except_fd_set,
2524  MHD_socket *max_fd);
2525 
2526 
2559 _MHD_EXTERN int
2560 MHD_get_fdset2 (struct MHD_Daemon *daemon,
2561  fd_set *read_fd_set,
2562  fd_set *write_fd_set,
2563  fd_set *except_fd_set,
2564  MHD_socket *max_fd,
2565  unsigned int fd_setsize);
2566 
2567 
2592 #define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
2593  MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \
2594  (max_fd),FD_SETSIZE)
2595 
2596 
2615 _MHD_EXTERN int
2616 MHD_get_timeout (struct MHD_Daemon *daemon,
2617  MHD_UNSIGNED_LONG_LONG *timeout);
2618 
2619 
2640 _MHD_EXTERN int
2641 MHD_run (struct MHD_Daemon *daemon);
2642 
2643 
2666 _MHD_EXTERN int
2667 MHD_run_from_select (struct MHD_Daemon *daemon,
2668  const fd_set *read_fd_set,
2669  const fd_set *write_fd_set,
2670  const fd_set *except_fd_set);
2671 
2672 
2673 
2674 
2675 /* **************** Connection handling functions ***************** */
2676 
2689 _MHD_EXTERN int
2690 MHD_get_connection_values (struct MHD_Connection *connection,
2691  enum MHD_ValueKind kind,
2692  MHD_KeyValueIterator iterator,
2693  void *iterator_cls);
2694 
2695 
2708 _MHD_EXTERN int
2709 MHD_get_connection_values_n (struct MHD_Connection *connection,
2710  enum MHD_ValueKind kind,
2711  MHD_KeyValueIteratorN iterator,
2712  void *iterator_cls);
2713 
2714 
2741 _MHD_EXTERN int
2742 MHD_set_connection_value (struct MHD_Connection *connection,
2743  enum MHD_ValueKind kind,
2744  const char *key,
2745  const char *value);
2746 
2747 
2773 int
2774 MHD_set_connection_value_n (struct MHD_Connection *connection,
2775  enum MHD_ValueKind kind,
2776  const char *key,
2777  size_t key_size,
2778  const char *value,
2779  size_t value_size);
2780 
2781 
2798 _MHD_EXTERN void
2799 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
2800 
2801 
2811 _MHD_EXTERN size_t
2812 MHD_http_unescape (char *val);
2813 
2814 
2825 _MHD_EXTERN const char *
2826 MHD_lookup_connection_value (struct MHD_Connection *connection,
2827  enum MHD_ValueKind kind,
2828  const char *key);
2829 
2830 
2850 _MHD_EXTERN int
2851 MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2852  enum MHD_ValueKind kind,
2853  const char *key,
2854  size_t key_size,
2855  const char **value_ptr,
2856  size_t *value_size_ptr);
2857 
2858 
2870 _MHD_EXTERN int
2871 MHD_queue_response (struct MHD_Connection *connection,
2872  unsigned int status_code,
2873  struct MHD_Response *response);
2874 
2875 
2901 _MHD_EXTERN void
2902 MHD_suspend_connection (struct MHD_Connection *connection);
2903 
2904 
2919 _MHD_EXTERN void
2920 MHD_resume_connection (struct MHD_Connection *connection);
2921 
2922 
2923 /* **************** Response manipulation functions ***************** */
2924 
2925 
2930 {
2935 
2946 
2953 
2959 
2960 
2961 };
2962 
2963 
2968 {
2973 };
2974 
2975 
2984 _MHD_EXTERN int
2985 MHD_set_response_options (struct MHD_Response *response,
2986  enum MHD_ResponseFlags flags,
2987  ...);
2988 
2989 
3006 _MHD_EXTERN struct MHD_Response *
3007 MHD_create_response_from_callback (uint64_t size,
3008  size_t block_size,
3011 
3012 
3028  "MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
3029  _MHD_EXTERN struct MHD_Response *
3030 MHD_create_response_from_data (size_t size,
3031  void *data,
3032  int must_free,
3033  int must_copy);
3034 
3035 
3042 {
3043 
3051 
3059 
3068 
3069 };
3070 
3071 
3082 _MHD_EXTERN struct MHD_Response *
3083 MHD_create_response_from_buffer (size_t size,
3084  void *buffer,
3085  enum MHD_ResponseMemoryMode mode);
3086 
3087 
3088 
3089 
3100 _MHD_EXTERN struct MHD_Response *
3102  void *buffer,
3104  crfc);
3105 
3106 
3118 _MHD_EXTERN struct MHD_Response *
3119 MHD_create_response_from_fd (size_t size,
3120  int fd);
3121 
3122 
3136 _MHD_EXTERN struct MHD_Response *
3137 MHD_create_response_from_fd64 (uint64_t size,
3138  int fd);
3139 
3140 
3158  "Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3159  _MHD_EXTERN struct MHD_Response *
3161  int fd,
3162  off_t offset);
3163 
3164 #if ! defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
3165 /* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset()
3166  to minimize potential problems with different off_t sizes */
3167 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \
3168  _MHD_DEPR_IN_MACRO ( \
3169  "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3170  MHD_create_response_from_fd_at_offset64 ((size),(fd),(offset))
3171 #endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
3172 
3173 
3190 _MHD_EXTERN struct MHD_Response *
3192  int fd,
3193  uint64_t offset);
3194 
3195 
3203 {
3204 
3211 
3216 
3221 
3222 };
3223 
3224 
3230 struct MHD_UpgradeResponseHandle;
3231 
3232 
3245 _MHD_EXTERN int
3246 MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3247  enum MHD_UpgradeAction action,
3248  ...);
3249 
3250 
3298 typedef void
3299 (*MHD_UpgradeHandler)(void *cls,
3300  struct MHD_Connection *connection,
3301  void *con_cls,
3302  const char *extra_in,
3303  size_t extra_in_size,
3304  MHD_socket sock,
3305  struct MHD_UpgradeResponseHandle *urh);
3306 
3307 
3337 _MHD_EXTERN struct MHD_Response *
3339  void *upgrade_handler_cls);
3340 
3341 
3351 _MHD_EXTERN void
3352 MHD_destroy_response (struct MHD_Response *response);
3353 
3354 
3365 _MHD_EXTERN int
3366 MHD_add_response_header (struct MHD_Response *response,
3367  const char *header,
3368  const char *content);
3369 
3370 
3380 _MHD_EXTERN int
3381 MHD_add_response_footer (struct MHD_Response *response,
3382  const char *footer,
3383  const char *content);
3384 
3385 
3395 _MHD_EXTERN int
3396 MHD_del_response_header (struct MHD_Response *response,
3397  const char *header,
3398  const char *content);
3399 
3400 
3411 _MHD_EXTERN int
3412 MHD_get_response_headers (struct MHD_Response *response,
3413  MHD_KeyValueIterator iterator,
3414  void *iterator_cls);
3415 
3416 
3425 _MHD_EXTERN const char *
3426 MHD_get_response_header (struct MHD_Response *response,
3427  const char *key);
3428 
3429 
3430 /* ********************** PostProcessor functions ********************** */
3431 
3457 _MHD_EXTERN struct MHD_PostProcessor *
3458 MHD_create_post_processor (struct MHD_Connection *connection,
3459  size_t buffer_size,
3460  MHD_PostDataIterator iter, void *iter_cls);
3461 
3462 
3476 _MHD_EXTERN int
3477 MHD_post_process (struct MHD_PostProcessor *pp,
3478  const char *post_data, size_t post_data_len);
3479 
3480 
3491 _MHD_EXTERN int
3492 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
3493 
3494 
3495 /* ********************* Digest Authentication functions *************** */
3496 
3497 
3503 #define MHD_INVALID_NONCE -1
3504 
3505 
3514 _MHD_EXTERN char *
3515 MHD_digest_auth_get_username (struct MHD_Connection *connection);
3516 
3517 
3526 _MHD_EXTERN void
3527 MHD_free (void *ptr);
3528 
3529 
3534 {
3535 
3540 
3545 
3550 
3551 };
3552 
3553 
3568 _MHD_EXTERN int
3569 MHD_digest_auth_check2 (struct MHD_Connection *connection,
3570  const char *realm,
3571  const char *username,
3572  const char *password,
3573  unsigned int nonce_timeout,
3574  enum MHD_DigestAuthAlgorithm algo);
3575 
3576 
3595 _MHD_EXTERN int
3596 MHD_digest_auth_check (struct MHD_Connection *connection,
3597  const char *realm,
3598  const char *username,
3599  const char *password,
3600  unsigned int nonce_timeout);
3601 
3602 
3620 _MHD_EXTERN int
3621 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3622  const char *realm,
3623  const char *username,
3624  const uint8_t *digest,
3625  size_t digest_size,
3626  unsigned int nonce_timeout,
3627  enum MHD_DigestAuthAlgorithm algo);
3628 
3629 
3648 _MHD_EXTERN int
3649 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3650  const char *realm,
3651  const char *username,
3652  const uint8_t digest[MHD_MD5_DIGEST_SIZE],
3653  unsigned int nonce_timeout);
3654 
3655 
3671 _MHD_EXTERN int
3672 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3673  const char *realm,
3674  const char *opaque,
3675  struct MHD_Response *response,
3676  int signal_stale,
3677  enum MHD_DigestAuthAlgorithm algo);
3678 
3679 
3697 _MHD_EXTERN int
3698 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3699  const char *realm,
3700  const char *opaque,
3701  struct MHD_Response *response,
3702  int signal_stale);
3703 
3704 
3714 _MHD_EXTERN char *
3716  char**password);
3717 
3718 
3731 _MHD_EXTERN int
3733  const char *realm,
3734  struct MHD_Response *response);
3735 
3736 /* ********************** generic query functions ********************** */
3737 
3738 
3749 _MHD_EXTERN const union MHD_ConnectionInfo *
3750 MHD_get_connection_info (struct MHD_Connection *connection,
3751  enum MHD_ConnectionInfoType info_type,
3752  ...);
3753 
3754 
3760 {
3761 
3770 
3771 };
3772 
3773 
3783 _MHD_EXTERN int
3784 MHD_set_connection_option (struct MHD_Connection *connection,
3785  enum MHD_CONNECTION_OPTION option,
3786  ...);
3787 
3788 
3793 {
3798  size_t key_size;
3799 
3805 
3810 
3814  uint16_t port;
3815 
3820 
3824  unsigned int num_connections;
3825 
3833 };
3834 
3835 
3847 _MHD_EXTERN const union MHD_DaemonInfo *
3848 MHD_get_daemon_info (struct MHD_Daemon *daemon,
3849  enum MHD_DaemonInfoType info_type,
3850  ...);
3851 
3852 
3859 _MHD_EXTERN const char*
3860 MHD_get_version (void);
3861 
3862 
3868 {
3874 
3884 
3890 
3896 
3904 
3910 
3917 
3924 
3930 
3937 
3944 
3952 
3960 
3967 
3977 
3983 
3990 
4003 
4009 
4016 
4023 
4028 
4034 };
4035 
4036 
4048 _MHD_EXTERN int
4049 MHD_is_feature_supported (enum MHD_FEATURE feature);
4050 
4051 
4052 #if 0 /* keep Emacsens' auto-indent happy */
4053 {
4054 #endif
4055 #ifdef __cplusplus
4056 }
4057 #endif
4058 
4059 #endif
#define _MHD_DEPR_FUNC(msg)
Definition: microhttpd.h:277
int(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: microhttpd.h:2237
_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:338
_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:5672
_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:3804
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
Definition: connection.c:528
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
Definition: microhttpd.h:1347
MHD_socket listen_fd
Definition: microhttpd.h:3809
void * data
Definition: microhttpd.h:3031
_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:3031
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:1606
_MHD_EXTERN int MHD_get_timeout(struct MHD_Daemon *daemon, MHD_UNSIGNED_LONG_LONG *timeout)
Definition: daemon.c:3432
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2331
char * version
Definition: internal.h:722
_MHD_EXTERN int MHD_add_connection(struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen)
Definition: daemon.c:3113
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:2354
_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:655
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:452
MHD_RequestTerminationCode
Definition: microhttpd.h:1808
_MHD_EXTERN int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
MHD_socket connect_fd
Definition: microhttpd.h:1915
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:1162
_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:4809
intptr_t value
Definition: microhttpd.h:1742
MHD_ConnectionNotificationCode
Definition: microhttpd.h:1866
_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:1347
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
Definition: panic.c:56
#define MHD_UNSIGNED_LONG_LONG
Definition: microhttpd.h:290
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:2107
_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:1329
MHD_ResponseOptions
Definition: microhttpd.h:2967
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:3834
void * socket_context
Definition: internal.h:694
#define MHD_MD5_DIGEST_SIZE
Definition: microhttpd.h:314
MHD_CONNECTION_OPTION
Definition: microhttpd.h:3759
_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:1315
_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
MHD_DisableSanityCheck
Definition: microhttpd.h:1716
int fd
Definition: microhttpd.h:3161
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:6795
const char * url
Definition: internal.h:716
_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:1464
_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:1238
_MHD_EXTERN int MHD_add_response_footer(struct MHD_Response *response, const char *footer, const char *content)
Definition: response.c:177
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd_at_offset64(uint64_t size, int fd, uint64_t offset)
Definition: response.c:590
char * method
Definition: internal.h:710
#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:3626
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2315
MHD_DigestAuthAlgorithm
Definition: microhttpd.h:3533
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
Definition: digestauth.c:629
_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:1275
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
Definition: response.c:1211
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
Definition: daemon.c:2890
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:3894
void int must_free
Definition: microhttpd.h:3031
uint16_t port
Definition: internal.h:1608
struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
Definition: response.c:679
MHD_ValueKind
Definition: microhttpd.h:1757
struct MHD_Daemon * daemon
Definition: microhttpd.h:1941
_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:3167
MHD_FEATURE
Definition: microhttpd.h:3867
MHD_ConnectionInfoType
Definition: microhttpd.h:1956
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
Definition: response.c:632
_MHD_EXTERN int MHD_upgrade_action(struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action,...)
int off_t offset
Definition: microhttpd.h:3161
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:3960
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
Definition: response.c:737
unsigned int connection_timeout
Definition: microhttpd.h:1910
MHD_AcceptPolicyCallback apc
Definition: internal.h:1364
uint16_t port
Definition: microhttpd.h:3814
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:2166
_MHD_EXTERN struct MHD_Response * MHD_create_response_for_upgrade(MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls)
void * ptr_value
Definition: microhttpd.h:1748
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:2189
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:3299
_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:416
_MHD_EXTERN int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: connection.c:299
_MHD_EXTERN int MHD_run(struct MHD_Daemon *daemon)
Definition: daemon.c:4655
MHD_OPTION
MHD options.
Definition: microhttpd.h:1358
enum MHD_FLAG flags
Definition: microhttpd.h:3832
void * apc_cls
Definition: internal.h:1369
#define MHD_get_fdset(daemon, read_fd_set, write_fd_set, except_fd_set, max_fd)
Definition: microhttpd.h:2592
MHD_ContentReaderCallback crc
Definition: internal.h:1600
MHD_UpgradeAction
Definition: microhttpd.h:3202
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer_with_free_callback(size_t size, void *buffer, MHD_ContentReaderFreeCallback crfc)
Definition: response.c:759
MHD_DaemonInfoType
Definition: microhttpd.h:2042
_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:565
_MHD_EXTERN int MHD_is_feature_supported(enum MHD_FEATURE feature)
Definition: daemon.c:7076
struct sockaddr * client_addr
Definition: microhttpd.h:1935
_MHD_EXTERN int MHD_del_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:198
#define _MHD_DEPR_MACRO(msg)
Definition: microhttpd.h:246
_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:1121
MHD_ResponseFlags
Definition: microhttpd.h:2929
_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:4854
unsigned int num_connections
Definition: microhttpd.h:3824
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:2121
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
Definition: microhttpd.h:2215
_MHD_EXTERN const union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
Definition: daemon.c:6961
_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:1735
_MHD_EXTERN int MHD_set_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: connection.c:499
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:1029
#define MHD_RESPONSE_HEADER_KIND
Definition: microhttpd.h:1765
_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:3041
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:2921
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:2262