79 #ifndef MHD_MICROHTTPD_H
80 #define MHD_MICROHTTPD_H
103 #ifndef MHD_PLATFORM_H
106 #include <sys/types.h>
107 #if defined(_WIN32) && !defined(__CYGWIN__)
108 #include <ws2tcpip.h>
109 #if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
110 #define _SSIZE_T_DEFINED
111 typedef intptr_t ssize_t;
115 #include <sys/time.h>
116 #include <sys/socket.h>
120 #if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
122 #error Cygwin with winsock fd_set is not supported
129 #define MHD_VERSION 0x00095900
144 #define MHD_INVALID_NONCE -1
151 #define MHD_SIZE_UNKNOWN UINT64_MAX
153 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
157 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
158 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
160 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
161 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
165 #if defined(_WIN32) && defined(MHD_W32LIB)
166 #define _MHD_EXTERN extern
167 #elif defined (_WIN32) && defined(MHD_W32DLL)
169 #define _MHD_EXTERN __declspec(dllimport)
171 #define _MHD_EXTERN extern
175 #ifndef MHD_SOCKET_DEFINED
179 #if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
180 #define MHD_POSIX_SOCKETS 1
182 #define MHD_INVALID_SOCKET (-1)
184 #define MHD_WINSOCK_SOCKETS 1
185 #include <winsock2.h>
187 #define MHD_INVALID_SOCKET (INVALID_SOCKET)
189 #define MHD_SOCKET_DEFINED 1
195 #ifdef MHD_NO_DEPRECATION
196 #define _MHD_DEPR_MACRO(msg)
197 #define _MHD_NO_DEPR_IN_MACRO 1
198 #define _MHD_DEPR_IN_MACRO(msg)
199 #define _MHD_NO_DEPR_FUNC 1
200 #define _MHD_DEPR_FUNC(msg)
203 #ifndef _MHD_DEPR_MACRO
204 #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500
207 #define _MHD_INSTRMACRO(a) #a
208 #define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a)
210 #define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg))
211 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
212 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
214 #define _MHD_GCC_PRAG(x) _Pragma (#x)
215 #if (defined(__clang__) && (__clang_major__+0 >= 5 || \
216 (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) || \
217 __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8)
220 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg)
221 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
224 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg)
225 #if (defined(__clang__) && (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9)))
227 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
234 #ifndef _MHD_DEPR_MACRO
235 #define _MHD_DEPR_MACRO(msg)
238 #ifndef _MHD_DEPR_IN_MACRO
239 #define _MHD_NO_DEPR_IN_MACRO 1
240 #define _MHD_DEPR_IN_MACRO(msg)
243 #ifndef _MHD_DEPR_FUNC
244 #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400
246 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg))
247 #elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310
249 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
250 #elif (__GNUC__+0 >= 5) || (defined (__clang__) && \
251 (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9)))
253 #define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg)))
254 #elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1)
257 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
262 #ifndef _MHD_DEPR_FUNC
263 #define _MHD_NO_DEPR_FUNC 1
264 #define _MHD_DEPR_FUNC(msg)
272 #ifndef MHD_LONG_LONG
276 #define MHD_LONG_LONG long long
277 #define MHD_UNSIGNED_LONG_LONG unsigned long long
279 _MHD_DEPR_MACRO(
"Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
285 #ifndef MHD_LONG_LONG_PRINTF
289 #define MHD_LONG_LONG_PRINTF "ll"
290 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
292 _MHD_DEPR_MACRO(
"Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
303 #define MHD_HTTP_CONTINUE 100
304 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
305 #define MHD_HTTP_PROCESSING 102
307 #define MHD_HTTP_OK 200
308 #define MHD_HTTP_CREATED 201
309 #define MHD_HTTP_ACCEPTED 202
310 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
311 #define MHD_HTTP_NO_CONTENT 204
312 #define MHD_HTTP_RESET_CONTENT 205
313 #define MHD_HTTP_PARTIAL_CONTENT 206
314 #define MHD_HTTP_MULTI_STATUS 207
315 #define MHD_HTTP_ALREADY_REPORTED 208
317 #define MHD_HTTP_IM_USED 226
319 #define MHD_HTTP_MULTIPLE_CHOICES 300
320 #define MHD_HTTP_MOVED_PERMANENTLY 301
321 #define MHD_HTTP_FOUND 302
322 #define MHD_HTTP_SEE_OTHER 303
323 #define MHD_HTTP_NOT_MODIFIED 304
324 #define MHD_HTTP_USE_PROXY 305
325 #define MHD_HTTP_SWITCH_PROXY 306
326 #define MHD_HTTP_TEMPORARY_REDIRECT 307
327 #define MHD_HTTP_PERMANENT_REDIRECT 308
329 #define MHD_HTTP_BAD_REQUEST 400
330 #define MHD_HTTP_UNAUTHORIZED 401
331 #define MHD_HTTP_PAYMENT_REQUIRED 402
332 #define MHD_HTTP_FORBIDDEN 403
333 #define MHD_HTTP_NOT_FOUND 404
334 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
335 #define MHD_HTTP_NOT_ACCEPTABLE 406
337 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
338 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") 406
339 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
340 #define MHD_HTTP_REQUEST_TIMEOUT 408
341 #define MHD_HTTP_CONFLICT 409
342 #define MHD_HTTP_GONE 410
343 #define MHD_HTTP_LENGTH_REQUIRED 411
344 #define MHD_HTTP_PRECONDITION_FAILED 412
345 #define MHD_HTTP_PAYLOAD_TOO_LARGE 413
347 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
348 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") 413
349 #define MHD_HTTP_URI_TOO_LONG 414
351 #define MHD_HTTP_REQUEST_URI_TOO_LONG \
352 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") 414
353 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
354 #define MHD_HTTP_RANGE_NOT_SATISFIABLE 416
356 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
357 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416
358 #define MHD_HTTP_EXPECTATION_FAILED 417
360 #define MHD_HTTP_MISDIRECTED_REQUEST 421
361 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
362 #define MHD_HTTP_LOCKED 423
363 #define MHD_HTTP_FAILED_DEPENDENCY 424
364 #define MHD_HTTP_UNORDERED_COLLECTION 425
365 #define MHD_HTTP_UPGRADE_REQUIRED 426
367 #define MHD_HTTP_PRECONDITION_REQUIRED 428
368 #define MHD_HTTP_TOO_MANY_REQUESTS 429
369 #define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
371 #define MHD_HTTP_NO_RESPONSE 444
373 #define MHD_HTTP_RETRY_WITH 449
374 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
375 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
377 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
378 #define MHD_HTTP_NOT_IMPLEMENTED 501
379 #define MHD_HTTP_BAD_GATEWAY 502
380 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
381 #define MHD_HTTP_GATEWAY_TIMEOUT 504
382 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
383 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
384 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
385 #define MHD_HTTP_LOOP_DETECTED 508
386 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
387 #define MHD_HTTP_NOT_EXTENDED 510
388 #define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
408 #define MHD_ICY_FLAG ((uint32_t)(((uint32_t)1) << 31))
420 #define MHD_HTTP_HEADER_ACCEPT "Accept"
422 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
424 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
426 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
428 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
430 #define MHD_HTTP_HEADER_AGE "Age"
432 #define MHD_HTTP_HEADER_ALLOW "Allow"
434 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
436 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
438 #define MHD_HTTP_HEADER_CLOSE "Close"
440 #define MHD_HTTP_HEADER_CONNECTION "Connection"
442 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
444 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
446 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
448 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
450 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
452 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
454 #define MHD_HTTP_HEADER_DATE "Date"
456 #define MHD_HTTP_HEADER_ETAG "ETag"
458 #define MHD_HTTP_HEADER_EXPECT "Expect"
460 #define MHD_HTTP_HEADER_EXPIRES "Expires"
462 #define MHD_HTTP_HEADER_FROM "From"
464 #define MHD_HTTP_HEADER_HOST "Host"
466 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
468 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
470 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
472 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
474 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
476 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
478 #define MHD_HTTP_HEADER_LOCATION "Location"
480 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
482 #define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version"
484 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
486 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
488 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
490 #define MHD_HTTP_HEADER_RANGE "Range"
492 #define MHD_HTTP_HEADER_REFERER "Referer"
494 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
496 #define MHD_HTTP_HEADER_SERVER "Server"
498 #define MHD_HTTP_HEADER_TE "TE"
500 #define MHD_HTTP_HEADER_TRAILER "Trailer"
502 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
504 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
506 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
508 #define MHD_HTTP_HEADER_VARY "Vary"
510 #define MHD_HTTP_HEADER_VIA "Via"
512 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
514 #define MHD_HTTP_HEADER_WARNING "Warning"
518 #define MHD_HTTP_HEADER_A_IM "A-IM"
520 #define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions"
522 #define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime"
524 #define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features"
526 #define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch"
528 #define MHD_HTTP_HEADER_ALPN "ALPN"
530 #define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc"
532 #define MHD_HTTP_HEADER_ALT_USED "Alt-Used"
534 #define MHD_HTTP_HEADER_ALTERNATES "Alternates"
536 #define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref"
538 #define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control"
540 #define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info"
542 #define MHD_HTTP_HEADER_C_EXT "C-Ext"
544 #define MHD_HTTP_HEADER_C_MAN "C-Man"
546 #define MHD_HTTP_HEADER_C_OPT "C-Opt"
548 #define MHD_HTTP_HEADER_C_PEP "C-PEP"
550 #define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info"
552 #define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
554 #define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
556 #define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition"
558 #define MHD_HTTP_HEADER_CONTENT_ID "Content-ID"
560 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
562 #define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type"
564 #define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type"
566 #define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version"
568 #define MHD_HTTP_HEADER_COOKIE "Cookie"
570 #define MHD_HTTP_HEADER_COOKIE2 "Cookie2"
572 #define MHD_HTTP_HEADER_DASL "DASL"
574 #define MHD_HTTP_HEADER_DAV "DAV"
576 #define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style"
578 #define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base"
580 #define MHD_HTTP_HEADER_DEPTH "Depth"
582 #define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From"
584 #define MHD_HTTP_HEADER_DESTINATION "Destination"
586 #define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID"
588 #define MHD_HTTP_HEADER_DIGEST "Digest"
590 #define MHD_HTTP_HEADER_EXT "Ext"
592 #define MHD_HTTP_HEADER_FORWARDED "Forwarded"
594 #define MHD_HTTP_HEADER_GETPROFILE "GetProfile"
596 #define MHD_HTTP_HEADER_HOBAREG "Hobareg"
598 #define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings"
600 #define MHD_HTTP_HEADER_IM "IM"
602 #define MHD_HTTP_HEADER_IF "If"
604 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
606 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
608 #define MHD_HTTP_HEADER_LABEL "Label"
610 #define MHD_HTTP_HEADER_LINK "Link"
612 #define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token"
614 #define MHD_HTTP_HEADER_MAN "Man"
616 #define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime"
618 #define MHD_HTTP_HEADER_METER "Meter"
620 #define MHD_HTTP_HEADER_NEGOTIATE "Negotiate"
622 #define MHD_HTTP_HEADER_OPT "Opt"
624 #define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate"
626 #define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
628 #define MHD_HTTP_HEADER_ORIGIN "Origin"
630 #define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
632 #define MHD_HTTP_HEADER_P3P "P3P"
634 #define MHD_HTTP_HEADER_PEP "PEP"
636 #define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label"
638 #define MHD_HTTP_HEADER_PEP_INFO "Pep-Info"
640 #define MHD_HTTP_HEADER_POSITION "Position"
642 #define MHD_HTTP_HEADER_PREFER "Prefer"
644 #define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied"
646 #define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject"
648 #define MHD_HTTP_HEADER_PROTOCOL "Protocol"
650 #define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info"
652 #define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query"
654 #define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request"
656 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info"
658 #define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features"
660 #define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction"
662 #define MHD_HTTP_HEADER_PUBLIC "Public"
664 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
666 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY "Public-Key-Pins-Report-Only"
668 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
670 #define MHD_HTTP_HEADER_SAFE "Safe"
672 #define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply"
674 #define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag"
676 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept"
678 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions"
680 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key"
682 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol"
684 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version"
686 #define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme"
688 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
690 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
692 #define MHD_HTTP_HEADER_SETPROFILE "SetProfile"
694 #define MHD_HTTP_HEADER_SLUG "SLUG"
696 #define MHD_HTTP_HEADER_SOAPACTION "SoapAction"
698 #define MHD_HTTP_HEADER_STATUS_URI "Status-URI"
700 #define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security"
702 #define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability"
704 #define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control"
706 #define MHD_HTTP_HEADER_TCN "TCN"
708 #define MHD_HTTP_HEADER_TIMEOUT "Timeout"
710 #define MHD_HTTP_HEADER_TOPIC "Topic"
712 #define MHD_HTTP_HEADER_TTL "TTL"
714 #define MHD_HTTP_HEADER_URGENCY "Urgency"
716 #define MHD_HTTP_HEADER_URI "URI"
718 #define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary"
720 #define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest"
722 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
725 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin"
734 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
735 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
748 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
750 #define MHD_HTTP_METHOD_DELETE "DELETE"
752 #define MHD_HTTP_METHOD_GET "GET"
754 #define MHD_HTTP_METHOD_HEAD "HEAD"
756 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
758 #define MHD_HTTP_METHOD_POST "POST"
760 #define MHD_HTTP_METHOD_PUT "PUT"
762 #define MHD_HTTP_METHOD_TRACE "TRACE"
766 #define MHD_HTTP_METHOD_ACL "ACL"
768 #define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL"
770 #define MHD_HTTP_METHOD_BIND "BIND"
772 #define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
774 #define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
776 #define MHD_HTTP_METHOD_COPY "COPY"
778 #define MHD_HTTP_METHOD_LABEL "LABEL"
780 #define MHD_HTTP_METHOD_LINK "LINK"
782 #define MHD_HTTP_METHOD_LOCK "LOCK"
784 #define MHD_HTTP_METHOD_MERGE "MERGE"
786 #define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
788 #define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
790 #define MHD_HTTP_METHOD_MKCOL "MKCOL"
792 #define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
794 #define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
796 #define MHD_HTTP_METHOD_MOVE "MOVE"
798 #define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
800 #define MHD_HTTP_METHOD_PATCH "PATCH"
802 #define MHD_HTTP_METHOD_PRI "PRI"
804 #define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
806 #define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
808 #define MHD_HTTP_METHOD_REBIND "REBIND"
810 #define MHD_HTTP_METHOD_REPORT "REPORT"
812 #define MHD_HTTP_METHOD_SEARCH "SEARCH"
814 #define MHD_HTTP_METHOD_UNBIND "UNBIND"
816 #define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
818 #define MHD_HTTP_METHOD_UNLINK "UNLINK"
820 #define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
822 #define MHD_HTTP_METHOD_UPDATE "UPDATE"
824 #define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF"
826 #define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL"
835 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
836 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
867 struct MHD_PostProcessor;
911 #define MHD_USE_SSL \
912 _MHD_DEPR_IN_MACRO("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
936 #define MHD_USE_SELECT_INTERNALLY \
937 _MHD_DEPR_IN_MACRO("Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \
938 MHD_USE_INTERNAL_POLLING_THREAD
961 #define MHD_USE_PEDANTIC_CHECKS \
962 _MHD_DEPR_IN_MACRO("Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \
985 #define MHD_USE_POLL_INTERNALLY \
986 _MHD_DEPR_IN_MACRO("Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \
987 MHD_USE_POLL_INTERNAL_THREAD
1001 #define MHD_SUPPRESS_DATE_NO_CLOCK \
1002 _MHD_DEPR_IN_MACRO("Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
1003 MHD_USE_SUPPRESS_DATE_NO_CLOCK
1027 #define MHD_USE_EPOLL_LINUX_ONLY \
1028 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
1045 #define MHD_USE_EPOLL_INTERNALLY \
1046 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1047 MHD_USE_EPOLL_INTERNAL_THREAD
1049 #define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \
1050 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
1051 MHD_USE_EPOLL_INTERNAL_THREAD
1071 #define MHD_USE_PIPE_FOR_SHUTDOWN \
1072 _MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
1092 #define MHD_USE_EPOLL_TURBO \
1093 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
1106 #define MHD_USE_SUSPEND_RESUME \
1107 _MHD_DEPR_IN_MACRO("Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \
1108 MHD_ALLOW_SUSPEND_RESUME
1525 #define MHD_RESPONSE_HEADER_KIND \
1526 _MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
1527 MHD_RESPONSE_HEADER_KIND
1869 const char *reason);
1881 const struct sockaddr *addr,
1930 const char *upload_data,
1931 size_t *upload_data_size,
2089 const char *filename,
2090 const char *content_type,
2091 const char *transfer_encoding,
2218 const struct sockaddr *addr,
2253 fd_set *read_fd_set,
2254 fd_set *write_fd_set,
2255 fd_set *except_fd_set,
2293 fd_set *read_fd_set,
2294 fd_set *write_fd_set,
2295 fd_set *except_fd_set,
2297 unsigned int fd_setsize);
2324 #define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
2325 MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE)
2399 const fd_set *read_fd_set,
2400 const fd_set *write_fd_set,
2401 const fd_set *except_fd_set);
2423 void *iterator_cls);
2521 unsigned int status_code,
2658 _MHD_DEPR_FUNC(
"MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()")
\
2768 _MHD_DEPR_FUNC(
"Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()")
\
2774 #if !defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
2777 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \
2778 _MHD_DEPR_IN_MACRO("Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
2779 MHD_create_response_from_fd_at_offset64((size),(fd),(offset))
2829 struct MHD_UpgradeResponseHandle;
2901 const char *extra_in,
2902 size_t extra_in_size,
2904 struct MHD_UpgradeResponseHandle *urh);
2938 void *upgrade_handler_cls);
2967 const char *content);
2982 const char *content);
2997 const char *content);
3076 const char *post_data,
size_t post_data_len);
3101 #define MHD_INVALID_NONCE -1
3144 const char *username,
3145 const char *password,
3146 unsigned int nonce_timeout);
#define _MHD_DEPR_FUNC(msg)
int(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
_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)
_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)
_MHD_EXTERN const char * MHD_get_version(void)
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
_MHD_EXTERN union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
_MHD_EXTERN int MHD_add_response_header(struct MHD_Response *response, const char *header, const char *content)
MHD_ContentReaderFreeCallback crfc
_MHD_EXTERN int MHD_get_timeout(struct MHD_Daemon *daemon, MHD_UNSIGNED_LONG_LONG *timeout)
void(* MHD_ContentReaderFreeCallback)(void *cls)
_MHD_EXTERN int MHD_add_connection(struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen)
_MHD_EXTERN int MHD_queue_basic_auth_fail_response(struct MHD_Connection *connection, const char *realm, struct MHD_Response *response)
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd64(uint64_t size, int fd)
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
MHD_RequestTerminationCode
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)
_MHD_EXTERN int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
_MHD_EXTERN int MHD_digest_auth_check(struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout)
_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,...)
MHD_ConnectionNotificationCode
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
#define MHD_UNSIGNED_LONG_LONG
_MHD_EXTERN struct MHD_PostProcessor * MHD_create_post_processor(struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iter, void *iter_cls)
_MHD_EXTERN char * MHD_basic_auth_get_username_password(struct MHD_Connection *connection, char **password)
_MHD_EXTERN union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
_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)
_MHD_EXTERN int MHD_add_response_footer(struct MHD_Response *response, const char *footer, const char *content)
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd_at_offset64(uint64_t size, int fd, uint64_t offset)
_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)
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
struct MHD_Daemon * daemon
_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)
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
_MHD_EXTERN int MHD_upgrade_action(struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action,...)
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
unsigned int connection_timeout
MHD_AcceptPolicyCallback apc
_MHD_EXTERN struct MHD_Response * MHD_create_response_for_upgrade(MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls)
_MHD_EXTERN void MHD_free(void *ptr)
_MHD_EXTERN int MHD_set_response_options(struct MHD_Response *response, enum MHD_ResponseFlags flags,...)
_MHD_EXTERN int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
_MHD_EXTERN int MHD_run(struct MHD_Daemon *daemon)
#define MHD_get_fdset(daemon, read_fd_set, write_fd_set, except_fd_set, max_fd)
MHD_ContentReaderCallback crc
_MHD_EXTERN int MHD_is_feature_supported(enum MHD_FEATURE feature)
struct sockaddr * client_addr
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)
_MHD_EXTERN int MHD_del_response_header(struct MHD_Response *response, const char *header, const char *content)
#define _MHD_DEPR_MACRO(msg)
_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)
_MHD_EXTERN const char * MHD_get_response_header(struct MHD_Response *response, const char *key)
_MHD_EXTERN MHD_socket MHD_quiesce_daemon(struct MHD_Daemon *daemon)
unsigned int num_connections
_MHD_EXTERN size_t MHD_http_unescape(char *val)
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)
_MHD_EXTERN const char * MHD_get_reason_phrase_for(unsigned int code)
_MHD_EXTERN int MHD_set_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value)
MHD_FLAG
Flags for the struct MHD_Daemon.
#define MHD_RESPONSE_HEADER_KIND
_MHD_EXTERN int MHD_get_response_headers(struct MHD_Response *response, MHD_KeyValueIterator iterator, void *iterator_cls)
void(* MHD_LogCallback)(void *cls, const char *fm, va_list ap)
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)