79 #ifndef MHD_MICROHTTPD_H 80 #define MHD_MICROHTTPD_H 103 #ifndef MHD_PLATFORM_H 104 #if defined(_WIN32) && ! defined(__CYGWIN__) && \ 105 ! defined(_CRT_DECLARE_NONSTDC_NAMES) 106 #define _CRT_DECLARE_NONSTDC_NAMES 1 110 #include <sys/types.h> 111 #if !defined(_WIN32) || defined(__CYGWIN__) 113 #include <sys/time.h> 114 #include <sys/socket.h> 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;
126 #if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET) 128 #error Cygwin with winsock fd_set is not supported 135 #define MHD_VERSION 0x00096500 150 #define MHD_INVALID_NONCE -1 157 #define MHD_SIZE_UNKNOWN UINT64_MAX 159 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL) 163 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX 164 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1) 166 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL) 167 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1) 171 #if defined(_WIN32) && defined(MHD_W32LIB) 172 #define _MHD_EXTERN extern 173 #elif defined (_WIN32) && defined(MHD_W32DLL) 175 #define _MHD_EXTERN __declspec(dllimport) 177 #define _MHD_EXTERN extern 181 #ifndef MHD_SOCKET_DEFINED 185 #if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) 186 #define MHD_POSIX_SOCKETS 1 188 #define MHD_INVALID_SOCKET (-1) 190 #define MHD_WINSOCK_SOCKETS 1 191 #include <winsock2.h> 193 #define MHD_INVALID_SOCKET (INVALID_SOCKET) 195 #define MHD_SOCKET_DEFINED 1 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) 209 #ifndef _MHD_DEPR_MACRO 210 #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500 213 #define _MHD_INSTRMACRO(a) #a 214 #define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a) 216 #define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg)) 217 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 218 #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) 220 #define _MHD_GCC_PRAG(x) _Pragma (#x) 221 #if (defined(__clang__) && (__clang_major__+0 >= 5 || \ 222 (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) || \ 223 __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8) 226 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg) 227 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 230 #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg) 231 #if (defined(__clang__) && (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) 233 #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) 240 #ifndef _MHD_DEPR_MACRO 241 #define _MHD_DEPR_MACRO(msg) 244 #ifndef _MHD_DEPR_IN_MACRO 245 #define _MHD_NO_DEPR_IN_MACRO 1 246 #define _MHD_DEPR_IN_MACRO(msg) 249 #ifndef _MHD_DEPR_FUNC 250 #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400 252 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg)) 253 #elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310 255 #define _MHD_DEPR_FUNC(msg) __declspec(deprecated) 256 #elif (__GNUC__+0 >= 5) || (defined (__clang__) && \ 257 (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) 259 #define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg))) 260 #elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1) 263 #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__)) 268 #ifndef _MHD_DEPR_FUNC 269 #define _MHD_NO_DEPR_FUNC 1 270 #define _MHD_DEPR_FUNC(msg) 278 #ifndef MHD_LONG_LONG 282 #define MHD_LONG_LONG long long 283 #define MHD_UNSIGNED_LONG_LONG unsigned long long 285 _MHD_DEPR_MACRO(
"Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
291 #ifndef MHD_LONG_LONG_PRINTF 295 #define MHD_LONG_LONG_PRINTF "ll" 296 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu" 298 _MHD_DEPR_MACRO(
"Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
305 #define MHD_MD5_DIGEST_SIZE 16 317 #define MHD_HTTP_CONTINUE 100 319 #define MHD_HTTP_SWITCHING_PROTOCOLS 101 321 #define MHD_HTTP_PROCESSING 102 323 #define MHD_HTTP_EARLY_HINTS 103 326 #define MHD_HTTP_OK 200 328 #define MHD_HTTP_CREATED 201 330 #define MHD_HTTP_ACCEPTED 202 332 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203 334 #define MHD_HTTP_NO_CONTENT 204 336 #define MHD_HTTP_RESET_CONTENT 205 338 #define MHD_HTTP_PARTIAL_CONTENT 206 340 #define MHD_HTTP_MULTI_STATUS 207 342 #define MHD_HTTP_ALREADY_REPORTED 208 345 #define MHD_HTTP_IM_USED 226 348 #define MHD_HTTP_MULTIPLE_CHOICES 300 350 #define MHD_HTTP_MOVED_PERMANENTLY 301 352 #define MHD_HTTP_FOUND 302 354 #define MHD_HTTP_SEE_OTHER 303 356 #define MHD_HTTP_NOT_MODIFIED 304 358 #define MHD_HTTP_USE_PROXY 305 360 #define MHD_HTTP_SWITCH_PROXY 306 362 #define MHD_HTTP_TEMPORARY_REDIRECT 307 364 #define MHD_HTTP_PERMANENT_REDIRECT 308 367 #define MHD_HTTP_BAD_REQUEST 400 369 #define MHD_HTTP_UNAUTHORIZED 401 371 #define MHD_HTTP_PAYMENT_REQUIRED 402 373 #define MHD_HTTP_FORBIDDEN 403 375 #define MHD_HTTP_NOT_FOUND 404 377 #define MHD_HTTP_METHOD_NOT_ALLOWED 405 379 #define MHD_HTTP_NOT_ACCEPTABLE 406 381 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407 383 #define MHD_HTTP_REQUEST_TIMEOUT 408 385 #define MHD_HTTP_CONFLICT 409 387 #define MHD_HTTP_GONE 410 389 #define MHD_HTTP_LENGTH_REQUIRED 411 391 #define MHD_HTTP_PRECONDITION_FAILED 412 393 #define MHD_HTTP_PAYLOAD_TOO_LARGE 413 395 #define MHD_HTTP_URI_TOO_LONG 414 397 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415 399 #define MHD_HTTP_RANGE_NOT_SATISFIABLE 416 401 #define MHD_HTTP_EXPECTATION_FAILED 417 404 #define MHD_HTTP_MISDIRECTED_REQUEST 421 406 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422 408 #define MHD_HTTP_LOCKED 423 410 #define MHD_HTTP_FAILED_DEPENDENCY 424 412 #define MHD_HTTP_TOO_EARLY 425 414 #define MHD_HTTP_UPGRADE_REQUIRED 426 417 #define MHD_HTTP_PRECONDITION_REQUIRED 428 419 #define MHD_HTTP_TOO_MANY_REQUESTS 429 422 #define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431 425 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451 428 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500 430 #define MHD_HTTP_NOT_IMPLEMENTED 501 432 #define MHD_HTTP_BAD_GATEWAY 502 434 #define MHD_HTTP_SERVICE_UNAVAILABLE 503 436 #define MHD_HTTP_GATEWAY_TIMEOUT 504 438 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505 440 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506 442 #define MHD_HTTP_INSUFFICIENT_STORAGE 507 444 #define MHD_HTTP_LOOP_DETECTED 508 447 #define MHD_HTTP_NOT_EXTENDED 510 449 #define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511 454 #define MHD_HTTP_RETRY_WITH 449 457 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450 460 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509 465 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE \ 466 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") 406 469 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \ 470 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") 413 473 #define MHD_HTTP_REQUEST_URI_TOO_LONG \ 474 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") 414 477 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \ 478 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416 481 #define MHD_HTTP_UNORDERED_COLLECTION \ 482 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") 425 485 #define MHD_HTTP_NO_RESPONSE \ 486 _MHD_DEPR_IN_MACRO("Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for logs only") 444 507 #define MHD_ICY_FLAG ((uint32_t)(((uint32_t)1) << 31)) 519 #define MHD_HTTP_HEADER_ACCEPT "Accept" 521 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset" 523 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding" 525 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language" 527 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges" 529 #define MHD_HTTP_HEADER_AGE "Age" 531 #define MHD_HTTP_HEADER_ALLOW "Allow" 533 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization" 535 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control" 537 #define MHD_HTTP_HEADER_CLOSE "Close" 539 #define MHD_HTTP_HEADER_CONNECTION "Connection" 541 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding" 543 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language" 545 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length" 547 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location" 549 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range" 551 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type" 553 #define MHD_HTTP_HEADER_DATE "Date" 555 #define MHD_HTTP_HEADER_ETAG "ETag" 557 #define MHD_HTTP_HEADER_EXPECT "Expect" 559 #define MHD_HTTP_HEADER_EXPIRES "Expires" 561 #define MHD_HTTP_HEADER_FROM "From" 563 #define MHD_HTTP_HEADER_HOST "Host" 565 #define MHD_HTTP_HEADER_IF_MATCH "If-Match" 567 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since" 569 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match" 571 #define MHD_HTTP_HEADER_IF_RANGE "If-Range" 573 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since" 575 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified" 577 #define MHD_HTTP_HEADER_LOCATION "Location" 579 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards" 581 #define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version" 583 #define MHD_HTTP_HEADER_PRAGMA "Pragma" 585 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate" 587 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization" 589 #define MHD_HTTP_HEADER_RANGE "Range" 591 #define MHD_HTTP_HEADER_REFERER "Referer" 593 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After" 595 #define MHD_HTTP_HEADER_SERVER "Server" 597 #define MHD_HTTP_HEADER_TE "TE" 599 #define MHD_HTTP_HEADER_TRAILER "Trailer" 601 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding" 603 #define MHD_HTTP_HEADER_UPGRADE "Upgrade" 605 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent" 607 #define MHD_HTTP_HEADER_VARY "Vary" 609 #define MHD_HTTP_HEADER_VIA "Via" 611 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate" 613 #define MHD_HTTP_HEADER_WARNING "Warning" 617 #define MHD_HTTP_HEADER_A_IM "A-IM" 619 #define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions" 621 #define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime" 623 #define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features" 625 #define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch" 627 #define MHD_HTTP_HEADER_ACCEPT_POST "Accept-Post" 629 #define MHD_HTTP_HEADER_ALPN "ALPN" 631 #define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc" 633 #define MHD_HTTP_HEADER_ALT_USED "Alt-Used" 635 #define MHD_HTTP_HEADER_ALTERNATES "Alternates" 637 #define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref" 639 #define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control" 641 #define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info" 643 #define MHD_HTTP_HEADER_C_EXT "C-Ext" 645 #define MHD_HTTP_HEADER_C_MAN "C-Man" 647 #define MHD_HTTP_HEADER_C_OPT "C-Opt" 649 #define MHD_HTTP_HEADER_C_PEP "C-PEP" 651 #define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info" 653 #define MHD_HTTP_HEADER_CAL_MANAGED_ID "Cal-Managed-ID" 655 #define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones" 657 #define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop" 659 #define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base" 661 #define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition" 663 #define MHD_HTTP_HEADER_CONTENT_ID "Content-ID" 665 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5" 667 #define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type" 669 #define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type" 671 #define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version" 673 #define MHD_HTTP_HEADER_COOKIE "Cookie" 675 #define MHD_HTTP_HEADER_COOKIE2 "Cookie2" 677 #define MHD_HTTP_HEADER_DASL "DASL" 679 #define MHD_HTTP_HEADER_DAV "DAV" 681 #define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style" 683 #define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base" 685 #define MHD_HTTP_HEADER_DEPTH "Depth" 687 #define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From" 689 #define MHD_HTTP_HEADER_DESTINATION "Destination" 691 #define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID" 693 #define MHD_HTTP_HEADER_DIGEST "Digest" 695 #define MHD_HTTP_HEADER_EARLY_DATA "Early-Data" 697 #define MHD_HTTP_HEADER_EXPECT_CT "Expect-CT" 699 #define MHD_HTTP_HEADER_EXT "Ext" 701 #define MHD_HTTP_HEADER_FORWARDED "Forwarded" 703 #define MHD_HTTP_HEADER_GETPROFILE "GetProfile" 705 #define MHD_HTTP_HEADER_HOBAREG "Hobareg" 707 #define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings" 709 #define MHD_HTTP_HEADER_IM "IM" 711 #define MHD_HTTP_HEADER_IF "If" 713 #define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match" 715 #define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID "Include-Referred-Token-Binding-ID" 717 #define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive" 719 #define MHD_HTTP_HEADER_LABEL "Label" 721 #define MHD_HTTP_HEADER_LINK "Link" 723 #define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token" 725 #define MHD_HTTP_HEADER_MAN "Man" 727 #define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime" 729 #define MHD_HTTP_HEADER_METER "Meter" 731 #define MHD_HTTP_HEADER_NEGOTIATE "Negotiate" 733 #define MHD_HTTP_HEADER_OPT "Opt" 735 #define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate" 737 #define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type" 739 #define MHD_HTTP_HEADER_ORIGIN "Origin" 741 #define MHD_HTTP_HEADER_OSCORE "OSCORE" 743 #define MHD_HTTP_HEADER_OVERWRITE "Overwrite" 745 #define MHD_HTTP_HEADER_P3P "P3P" 747 #define MHD_HTTP_HEADER_PEP "PEP" 749 #define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label" 751 #define MHD_HTTP_HEADER_PEP_INFO "Pep-Info" 753 #define MHD_HTTP_HEADER_POSITION "Position" 755 #define MHD_HTTP_HEADER_PREFER "Prefer" 757 #define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied" 759 #define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject" 761 #define MHD_HTTP_HEADER_PROTOCOL "Protocol" 763 #define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info" 765 #define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query" 767 #define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request" 769 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info" 771 #define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features" 773 #define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction" 775 #define MHD_HTTP_HEADER_PUBLIC "Public" 777 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins" 779 #define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY "Public-Key-Pins-Report-Only" 781 #define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref" 783 #define MHD_HTTP_HEADER_REPLAY_NONCE "Replay-Nonce" 785 #define MHD_HTTP_HEADER_SAFE "Safe" 787 #define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply" 789 #define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag" 791 #define MHD_HTTP_HEADER_SEC_TOKEN_BINDING "Sec-Token-Binding" 793 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept" 795 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions" 797 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key" 799 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol" 801 #define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version" 803 #define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme" 805 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie" 807 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2" 809 #define MHD_HTTP_HEADER_SETPROFILE "SetProfile" 811 #define MHD_HTTP_HEADER_SLUG "SLUG" 813 #define MHD_HTTP_HEADER_SOAPACTION "SoapAction" 815 #define MHD_HTTP_HEADER_STATUS_URI "Status-URI" 817 #define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security" 819 #define MHD_HTTP_HEADER_SUNSET "Sunset" 821 #define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability" 823 #define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control" 825 #define MHD_HTTP_HEADER_TCN "TCN" 827 #define MHD_HTTP_HEADER_TIMEOUT "Timeout" 829 #define MHD_HTTP_HEADER_TOPIC "Topic" 831 #define MHD_HTTP_HEADER_TTL "TTL" 833 #define MHD_HTTP_HEADER_URGENCY "Urgency" 835 #define MHD_HTTP_HEADER_URI "URI" 837 #define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary" 839 #define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest" 841 #define MHD_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS "X-Content-Type-Options" 843 #define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options" 846 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin" 855 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0" 856 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1" 870 #define MHD_HTTP_METHOD_CONNECT "CONNECT" 872 #define MHD_HTTP_METHOD_DELETE "DELETE" 874 #define MHD_HTTP_METHOD_GET "GET" 876 #define MHD_HTTP_METHOD_HEAD "HEAD" 878 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS" 880 #define MHD_HTTP_METHOD_POST "POST" 882 #define MHD_HTTP_METHOD_PUT "PUT" 884 #define MHD_HTTP_METHOD_TRACE "TRACE" 888 #define MHD_HTTP_METHOD_ACL "ACL" 890 #define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL" 892 #define MHD_HTTP_METHOD_BIND "BIND" 894 #define MHD_HTTP_METHOD_CHECKIN "CHECKIN" 896 #define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT" 898 #define MHD_HTTP_METHOD_COPY "COPY" 900 #define MHD_HTTP_METHOD_LABEL "LABEL" 902 #define MHD_HTTP_METHOD_LINK "LINK" 904 #define MHD_HTTP_METHOD_LOCK "LOCK" 906 #define MHD_HTTP_METHOD_MERGE "MERGE" 908 #define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY" 910 #define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR" 912 #define MHD_HTTP_METHOD_MKCOL "MKCOL" 914 #define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF" 916 #define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE" 918 #define MHD_HTTP_METHOD_MOVE "MOVE" 920 #define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH" 922 #define MHD_HTTP_METHOD_PATCH "PATCH" 924 #define MHD_HTTP_METHOD_PRI "PRI" 926 #define MHD_HTTP_METHOD_PROPFIND "PROPFIND" 928 #define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH" 930 #define MHD_HTTP_METHOD_REBIND "REBIND" 932 #define MHD_HTTP_METHOD_REPORT "REPORT" 934 #define MHD_HTTP_METHOD_SEARCH "SEARCH" 936 #define MHD_HTTP_METHOD_UNBIND "UNBIND" 938 #define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT" 940 #define MHD_HTTP_METHOD_UNLINK "UNLINK" 942 #define MHD_HTTP_METHOD_UNLOCK "UNLOCK" 944 #define MHD_HTTP_METHOD_UPDATE "UPDATE" 946 #define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF" 948 #define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL" 957 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded" 958 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data" 989 struct MHD_PostProcessor;
1033 #define MHD_USE_SSL \ 1034 _MHD_DEPR_IN_MACRO("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \ 1058 #define MHD_USE_SELECT_INTERNALLY \ 1059 _MHD_DEPR_IN_MACRO("Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \ 1060 MHD_USE_INTERNAL_POLLING_THREAD 1083 #define MHD_USE_PEDANTIC_CHECKS \ 1084 _MHD_DEPR_IN_MACRO("Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \ 1107 #define MHD_USE_POLL_INTERNALLY \ 1108 _MHD_DEPR_IN_MACRO("Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \ 1109 MHD_USE_POLL_INTERNAL_THREAD 1123 #define MHD_SUPPRESS_DATE_NO_CLOCK \ 1124 _MHD_DEPR_IN_MACRO("Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \ 1125 MHD_USE_SUPPRESS_DATE_NO_CLOCK 1149 #define MHD_USE_EPOLL_LINUX_ONLY \ 1150 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \ 1167 #define MHD_USE_EPOLL_INTERNALLY \ 1168 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \ 1169 MHD_USE_EPOLL_INTERNAL_THREAD 1171 #define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \ 1172 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \ 1173 MHD_USE_EPOLL_INTERNAL_THREAD 1193 #define MHD_USE_PIPE_FOR_SHUTDOWN \ 1194 _MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \ 1214 #define MHD_USE_EPOLL_TURBO \ 1215 _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \ 1228 #define MHD_USE_SUSPEND_RESUME \ 1229 _MHD_DEPR_IN_MACRO("Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \ 1230 MHD_ALLOW_SUSPEND_RESUME 1312 const char *username,
1692 #define MHD_RESPONSE_HEADER_KIND \ 1693 _MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \ 1694 MHD_RESPONSE_HEADER_KIND 2036 const char *reason);
2048 const struct sockaddr *addr,
2097 const char *upload_data,
2098 size_t *upload_data_size,
2283 const char *filename,
2284 const char *content_type,
2285 const char *transfer_encoding,
2412 const struct sockaddr *addr,
2447 fd_set *read_fd_set,
2448 fd_set *write_fd_set,
2449 fd_set *except_fd_set,
2487 fd_set *read_fd_set,
2488 fd_set *write_fd_set,
2489 fd_set *except_fd_set,
2491 unsigned int fd_setsize);
2518 #define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \ 2519 MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE) 2593 const fd_set *read_fd_set,
2594 const fd_set *write_fd_set,
2595 const fd_set *except_fd_set);
2618 void *iterator_cls);
2637 void *iterator_cls);
2780 const char **value_ptr,
2781 size_t *value_size_ptr);
2797 unsigned int status_code,
2945 _MHD_DEPR_FUNC(
"MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
3073 _MHD_DEPR_FUNC(
"Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
3079 #if !defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC) 3082 #define MHD_create_response_from_fd_at_offset(size,fd,offset) \ 3083 _MHD_DEPR_IN_MACRO("Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \ 3084 MHD_create_response_from_fd_at_offset64((size),(fd),(offset)) 3134 struct MHD_UpgradeResponseHandle;
3206 const char *extra_in,
3207 size_t extra_in_size,
3209 struct MHD_UpgradeResponseHandle *urh);
3243 void *upgrade_handler_cls);
3272 const char *content);
3287 const char *content);
3302 const char *content);
3318 void *iterator_cls);
3382 const char *post_data,
size_t post_data_len);
3407 #define MHD_INVALID_NONCE -1 3474 const char *username,
3475 const char *password,
3476 unsigned int nonce_timeout,
3501 const char *username,
3502 const char *password,
3503 unsigned int nonce_timeout);
3526 const char *username,
3527 const uint8_t *digest,
3529 unsigned int nonce_timeout,
3554 const char *username,
3556 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 int MHD_get_connection_values_n(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIteratorN iterator, void *iterator_cls)
_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)
int(* MHD_PskServerCredentialsCallback)(void *cls, const struct MHD_Connection *connection, const char *username, void **psk, size_t *psk_size)
_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)
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_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)
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)
MHD_RequestTerminationCode
_MHD_EXTERN int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
_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 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)
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
#define MHD_UNSIGNED_LONG_LONG
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
_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)
_MHD_EXTERN const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
#define MHD_MD5_DIGEST_SIZE
_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)
_MHD_EXTERN char * MHD_basic_auth_get_username_password(struct MHD_Connection *connection, char **password)
_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_digest_auth_check2(struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo)
_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)
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
_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)
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
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
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 struct MHD_Response * MHD_create_response_for_upgrade(MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls)
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
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 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 struct MHD_Response * MHD_create_response_from_buffer_with_free_callback(size_t size, void *buffer, MHD_ContentReaderFreeCallback crfc)
_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)
_MHD_EXTERN int MHD_is_feature_supported(enum MHD_FEATURE feature)
struct sockaddr * client_addr
_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
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
void(* MHD_NotifyConnectionCallback)(void *cls, struct MHD_Connection *connection, void **socket_context, enum MHD_ConnectionNotificationCode toe)
_MHD_EXTERN const union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
_MHD_EXTERN size_t MHD_http_unescape(char *val)
_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)
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
int(* MHD_KeyValueIteratorN)(void *cls, enum MHD_ValueKind kind, const char *key, size_t key_size, const char *value, size_t value_size)