GNU libmicrohttpd  0.9.70
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 0x00097000
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 /* **************** Connection handling functions ***************** */
2674 
2687 _MHD_EXTERN int
2688 MHD_get_connection_values (struct MHD_Connection *connection,
2689  enum MHD_ValueKind kind,
2690  MHD_KeyValueIterator iterator,
2691  void *iterator_cls);
2692 
2693 
2706 _MHD_EXTERN int
2707 MHD_get_connection_values_n (struct MHD_Connection *connection,
2708  enum MHD_ValueKind kind,
2709  MHD_KeyValueIteratorN iterator,
2710  void *iterator_cls);
2711 
2712 
2739 _MHD_EXTERN int
2740 MHD_set_connection_value (struct MHD_Connection *connection,
2741  enum MHD_ValueKind kind,
2742  const char *key,
2743  const char *value);
2744 
2745 
2771 int
2772 MHD_set_connection_value_n (struct MHD_Connection *connection,
2773  enum MHD_ValueKind kind,
2774  const char *key,
2775  size_t key_size,
2776  const char *value,
2777  size_t value_size);
2778 
2779 
2796 _MHD_EXTERN void
2797 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
2798 
2799 
2809 _MHD_EXTERN size_t
2810 MHD_http_unescape (char *val);
2811 
2812 
2823 _MHD_EXTERN const char *
2824 MHD_lookup_connection_value (struct MHD_Connection *connection,
2825  enum MHD_ValueKind kind,
2826  const char *key);
2827 
2828 
2848 _MHD_EXTERN int
2849 MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2850  enum MHD_ValueKind kind,
2851  const char *key,
2852  size_t key_size,
2853  const char **value_ptr,
2854  size_t *value_size_ptr);
2855 
2856 
2868 _MHD_EXTERN int
2869 MHD_queue_response (struct MHD_Connection *connection,
2870  unsigned int status_code,
2871  struct MHD_Response *response);
2872 
2873 
2899 _MHD_EXTERN void
2900 MHD_suspend_connection (struct MHD_Connection *connection);
2901 
2902 
2917 _MHD_EXTERN void
2918 MHD_resume_connection (struct MHD_Connection *connection);
2919 
2920 
2921 /* **************** Response manipulation functions ***************** */
2922 
2923 
2928 {
2933 
2944 
2951 
2957 
2958 
2959 };
2960 
2961 
2966 {
2971 };
2972 
2973 
2982 _MHD_EXTERN int
2983 MHD_set_response_options (struct MHD_Response *response,
2984  enum MHD_ResponseFlags flags,
2985  ...);
2986 
2987 
3004 _MHD_EXTERN struct MHD_Response *
3005 MHD_create_response_from_callback (uint64_t size,
3006  size_t block_size,
3009 
3010 
3026  "MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
3027  _MHD_EXTERN struct MHD_Response *
3028 MHD_create_response_from_data (size_t size,
3029  void *data,
3030  int must_free,
3031  int must_copy);
3032 
3033 
3040 {
3041 
3049 
3057 
3066 
3067 };
3068 
3069 
3080 _MHD_EXTERN struct MHD_Response *
3081 MHD_create_response_from_buffer (size_t size,
3082  void *buffer,
3083  enum MHD_ResponseMemoryMode mode);
3084 
3085 
3096 _MHD_EXTERN struct MHD_Response *
3098  void *buffer,
3100  crfc);
3101 
3102 
3114 _MHD_EXTERN struct MHD_Response *
3115 MHD_create_response_from_fd (size_t size,
3116  int fd);
3117 
3118 
3132 _MHD_EXTERN struct MHD_Response *
3133 MHD_create_response_from_fd64 (uint64_t size,
3134  int fd);
3135 
3136 
3154  "Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3155  _MHD_EXTERN struct MHD_Response *
3157  int fd,
3158  off_t offset);
3159 
3160 #if ! defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
3161 /* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset()
3162  to minimize potential problems with different off_t sizes */
3163 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \
3164  _MHD_DEPR_IN_MACRO ( \
3165  "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3166  MHD_create_response_from_fd_at_offset64 ((size),(fd),(offset))
3167 #endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
3168 
3169 
3186 _MHD_EXTERN struct MHD_Response *
3188  int fd,
3189  uint64_t offset);
3190 
3191 
3199 {
3200 
3207 
3212 
3217 
3218 };
3219 
3220 
3226 struct MHD_UpgradeResponseHandle;
3227 
3228 
3241 _MHD_EXTERN int
3242 MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3243  enum MHD_UpgradeAction action,
3244  ...);
3245 
3246 
3294 typedef void
3295 (*MHD_UpgradeHandler)(void *cls,
3296  struct MHD_Connection *connection,
3297  void *con_cls,
3298  const char *extra_in,
3299  size_t extra_in_size,
3300  MHD_socket sock,
3301  struct MHD_UpgradeResponseHandle *urh);
3302 
3303 
3333 _MHD_EXTERN struct MHD_Response *
3335  void *upgrade_handler_cls);
3336 
3337 
3347 _MHD_EXTERN void
3348 MHD_destroy_response (struct MHD_Response *response);
3349 
3350 
3361 _MHD_EXTERN int
3362 MHD_add_response_header (struct MHD_Response *response,
3363  const char *header,
3364  const char *content);
3365 
3366 
3376 _MHD_EXTERN int
3377 MHD_add_response_footer (struct MHD_Response *response,
3378  const char *footer,
3379  const char *content);
3380 
3381 
3391 _MHD_EXTERN int
3392 MHD_del_response_header (struct MHD_Response *response,
3393  const char *header,
3394  const char *content);
3395 
3396 
3407 _MHD_EXTERN int
3408 MHD_get_response_headers (struct MHD_Response *response,
3409  MHD_KeyValueIterator iterator,
3410  void *iterator_cls);
3411 
3412 
3421 _MHD_EXTERN const char *
3422 MHD_get_response_header (struct MHD_Response *response,
3423  const char *key);
3424 
3425 
3426 /* ********************** PostProcessor functions ********************** */
3427 
3453 _MHD_EXTERN struct MHD_PostProcessor *
3454 MHD_create_post_processor (struct MHD_Connection *connection,
3455  size_t buffer_size,
3456  MHD_PostDataIterator iter, void *iter_cls);
3457 
3458 
3472 _MHD_EXTERN int
3473 MHD_post_process (struct MHD_PostProcessor *pp,
3474  const char *post_data, size_t post_data_len);
3475 
3476 
3487 _MHD_EXTERN int
3488 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
3489 
3490 
3491 /* ********************* Digest Authentication functions *************** */
3492 
3493 
3499 #define MHD_INVALID_NONCE -1
3500 
3501 
3510 _MHD_EXTERN char *
3511 MHD_digest_auth_get_username (struct MHD_Connection *connection);
3512 
3513 
3522 _MHD_EXTERN void
3523 MHD_free (void *ptr);
3524 
3525 
3530 {
3531 
3536 
3541 
3546 
3547 };
3548 
3549 
3564 _MHD_EXTERN int
3565 MHD_digest_auth_check2 (struct MHD_Connection *connection,
3566  const char *realm,
3567  const char *username,
3568  const char *password,
3569  unsigned int nonce_timeout,
3570  enum MHD_DigestAuthAlgorithm algo);
3571 
3572 
3591 _MHD_EXTERN int
3592 MHD_digest_auth_check (struct MHD_Connection *connection,
3593  const char *realm,
3594  const char *username,
3595  const char *password,
3596  unsigned int nonce_timeout);
3597 
3598 
3616 _MHD_EXTERN int
3617 MHD_digest_auth_check_digest2 (struct MHD_Connection *connection,
3618  const char *realm,
3619  const char *username,
3620  const uint8_t *digest,
3621  size_t digest_size,
3622  unsigned int nonce_timeout,
3623  enum MHD_DigestAuthAlgorithm algo);
3624 
3625 
3644 _MHD_EXTERN int
3645 MHD_digest_auth_check_digest (struct MHD_Connection *connection,
3646  const char *realm,
3647  const char *username,
3648  const uint8_t digest[MHD_MD5_DIGEST_SIZE],
3649  unsigned int nonce_timeout);
3650 
3651 
3667 _MHD_EXTERN int
3668 MHD_queue_auth_fail_response2 (struct MHD_Connection *connection,
3669  const char *realm,
3670  const char *opaque,
3671  struct MHD_Response *response,
3672  int signal_stale,
3673  enum MHD_DigestAuthAlgorithm algo);
3674 
3675 
3693 _MHD_EXTERN int
3694 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
3695  const char *realm,
3696  const char *opaque,
3697  struct MHD_Response *response,
3698  int signal_stale);
3699 
3700 
3710 _MHD_EXTERN char *
3712  char**password);
3713 
3714 
3727 _MHD_EXTERN int
3729  const char *realm,
3730  struct MHD_Response *response);
3731 
3732 /* ********************** generic query functions ********************** */
3733 
3734 
3745 _MHD_EXTERN const union MHD_ConnectionInfo *
3746 MHD_get_connection_info (struct MHD_Connection *connection,
3747  enum MHD_ConnectionInfoType info_type,
3748  ...);
3749 
3750 
3756 {
3757 
3766 
3767 };
3768 
3769 
3779 _MHD_EXTERN int
3780 MHD_set_connection_option (struct MHD_Connection *connection,
3781  enum MHD_CONNECTION_OPTION option,
3782  ...);
3783 
3784 
3789 {
3794  size_t key_size;
3795 
3801 
3806 
3810  uint16_t port;
3811 
3816 
3820  unsigned int num_connections;
3821 
3829 };
3830 
3831 
3843 _MHD_EXTERN const union MHD_DaemonInfo *
3844 MHD_get_daemon_info (struct MHD_Daemon *daemon,
3845  enum MHD_DaemonInfoType info_type,
3846  ...);
3847 
3848 
3855 _MHD_EXTERN const char*
3856 MHD_get_version (void);
3857 
3858 
3864 {
3870 
3880 
3886 
3892 
3900 
3906 
3913 
3920 
3926 
3933 
3940 
3948 
3956 
3963 
3973 
3979 
3986 
3999 
4005 
4012 
4019 
4024 
4030 };
4031 
4032 
4044 _MHD_EXTERN int
4045 MHD_is_feature_supported (enum MHD_FEATURE feature);
4046 
4047 
4048 #if 0 /* keep Emacsens' auto-indent happy */
4049 {
4050 #endif
4051 #ifdef __cplusplus
4052 }
4053 #endif
4054 
4055 #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:339
_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:5697
_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:3800
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
Definition: connection.c:529
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:3805
void * data
Definition: microhttpd.h:3029
_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:3029
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:3446
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:2331
char * version
Definition: internal.h:724
_MHD_EXTERN int MHD_add_connection(struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen)
Definition: daemon.c:3127
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:656
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:453
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:1156
_MHD_EXTERN struct MHD_Daemon * MHD_start_daemon(unsigned int flags, uint16_t port, MHD_AcceptPolicyCallback apc, void *apc_cls, MHD_AccessHandlerCallback dh, void *dh_cls,...)
Definition: daemon.c:4832
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: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: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:2965
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:3832
void * socket_context
Definition: internal.h:694
#define MHD_MD5_DIGEST_SIZE
Definition: microhttpd.h:314
MHD_CONNECTION_OPTION
Definition: microhttpd.h:3755
_MHD_EXTERN int MHD_digest_auth_check_digest(struct MHD_Connection *connection, const char *realm, const char *username, const uint8_t digest[MHD_MD5_DIGEST_SIZE], unsigned int nonce_timeout)
Definition: digestauth.c:1310
_MHD_EXTERN char * MHD_basic_auth_get_username_password(struct MHD_Connection *connection, char **password)
Definition: basicauth.c:47
void * crc_cls
Definition: internal.h:1594
MHD_DisableSanityCheck
Definition: microhttpd.h:1716
int fd
Definition: microhttpd.h:3157
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:6820
const char * url
Definition: internal.h:718
_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:1465
_MHD_EXTERN int MHD_digest_auth_check2(struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo)
Definition: digestauth.c:1231
_MHD_EXTERN 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:591
char * method
Definition: internal.h:712
#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:3640
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:2315
MHD_DigestAuthAlgorithm
Definition: microhttpd.h:3529
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
Definition: digestauth.c:628
_MHD_EXTERN int MHD_digest_auth_check_digest2(struct MHD_Connection *connection, const char *realm, const char *username, const uint8_t *digest, size_t digest_size, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo)
Definition: digestauth.c:1269
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
Definition: response.c:1214
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
Definition: daemon.c:2904
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:3892
void int must_free
Definition: microhttpd.h:3029
uint16_t port
Definition: internal.h:1610
struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
Definition: response.c:680
MHD_ValueKind
Definition: microhttpd.h: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:3163
MHD_FEATURE
Definition: microhttpd.h:3863
MHD_ConnectionInfoType
Definition: microhttpd.h:1956
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
Definition: response.c:633
_MHD_EXTERN int MHD_upgrade_action(struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action,...)
int off_t offset
Definition: microhttpd.h:3157
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:3958
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
Definition: response.c:738
unsigned int connection_timeout
Definition: microhttpd.h:1910
MHD_AcceptPolicyCallback apc
Definition: internal.h:1366
uint16_t port
Definition: microhttpd.h:3810
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:3295
_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:300
_MHD_EXTERN int MHD_run(struct MHD_Daemon *daemon)
Definition: daemon.c:4676
MHD_OPTION
MHD options.
Definition: microhttpd.h:1358
enum MHD_FLAG flags
Definition: microhttpd.h:3828
void * apc_cls
Definition: internal.h:1371
#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:3198
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer_with_free_callback(size_t size, void *buffer, MHD_ContentReaderFreeCallback crfc)
Definition: response.c:760
MHD_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:566
_MHD_EXTERN int MHD_is_feature_supported(enum MHD_FEATURE feature)
Definition: daemon.c:7101
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:1129
MHD_ResponseFlags
Definition: microhttpd.h:2927
_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:4877
unsigned int num_connections
Definition: microhttpd.h:3820
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:6986
_MHD_EXTERN size_t MHD_http_unescape(char *val)
Definition: internal.c:142
_MHD_EXTERN const char * MHD_get_reason_phrase_for(unsigned int code)
enum MHD_OPTION option
Definition: microhttpd.h: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:500
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:3039
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:2935
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