00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00086 #ifndef MHD_MICROHTTPD_H
00087 #define MHD_MICROHTTPD_H
00088
00089 #ifdef __cplusplus
00090 extern "C"
00091 {
00092 #if 0
00093 }
00094 #endif
00095 #endif
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #ifndef MHD_PLATFORM_H
00108 #include <unistd.h>
00109 #include <stdarg.h>
00110 #include <stdint.h>
00111 #ifdef __MINGW32__
00112 #include <ws2tcpip.h>
00113 #else
00114 #include <sys/time.h>
00115 #include <sys/types.h>
00116 #include <sys/socket.h>
00117 #endif
00118 #endif
00119
00124 #define MHD_VERSION 0x00093300
00125
00129 #define MHD_YES 1
00130
00134 #define MHD_NO 0
00135
00139 #define MHD_INVALID_NONCE -1
00140
00145 #ifdef UINT64_MAX
00146 #define MHD_SIZE_UNKNOWN UINT64_MAX
00147 #else
00148 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
00149 #endif
00150
00151 #ifdef SIZE_MAX
00152 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
00153 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
00154 #else
00155 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
00156 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
00157 #endif
00158
00164 #ifndef MHD_LONG_LONG
00165
00168 #define MHD_LONG_LONG long long
00169 #define MHD_UNSIGNED_LONG_LONG unsigned long long
00170 #endif
00171
00175 #ifndef MHD_LONG_LONG_PRINTF
00176
00179 #define MHD_LONG_LONG_PRINTF "ll"
00180 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
00181 #endif
00182
00183
00189 #define MHD_HTTP_CONTINUE 100
00190 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
00191 #define MHD_HTTP_PROCESSING 102
00192
00193 #define MHD_HTTP_OK 200
00194 #define MHD_HTTP_CREATED 201
00195 #define MHD_HTTP_ACCEPTED 202
00196 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
00197 #define MHD_HTTP_NO_CONTENT 204
00198 #define MHD_HTTP_RESET_CONTENT 205
00199 #define MHD_HTTP_PARTIAL_CONTENT 206
00200 #define MHD_HTTP_MULTI_STATUS 207
00201
00202 #define MHD_HTTP_MULTIPLE_CHOICES 300
00203 #define MHD_HTTP_MOVED_PERMANENTLY 301
00204 #define MHD_HTTP_FOUND 302
00205 #define MHD_HTTP_SEE_OTHER 303
00206 #define MHD_HTTP_NOT_MODIFIED 304
00207 #define MHD_HTTP_USE_PROXY 305
00208 #define MHD_HTTP_SWITCH_PROXY 306
00209 #define MHD_HTTP_TEMPORARY_REDIRECT 307
00210
00211 #define MHD_HTTP_BAD_REQUEST 400
00212 #define MHD_HTTP_UNAUTHORIZED 401
00213 #define MHD_HTTP_PAYMENT_REQUIRED 402
00214 #define MHD_HTTP_FORBIDDEN 403
00215 #define MHD_HTTP_NOT_FOUND 404
00216 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
00217 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE 406
00218 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
00219 #define MHD_HTTP_REQUEST_TIMEOUT 408
00220 #define MHD_HTTP_CONFLICT 409
00221 #define MHD_HTTP_GONE 410
00222 #define MHD_HTTP_LENGTH_REQUIRED 411
00223 #define MHD_HTTP_PRECONDITION_FAILED 412
00224 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE 413
00225 #define MHD_HTTP_REQUEST_URI_TOO_LONG 414
00226 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
00227 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE 416
00228 #define MHD_HTTP_EXPECTATION_FAILED 417
00229 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
00230 #define MHD_HTTP_LOCKED 423
00231 #define MHD_HTTP_FAILED_DEPENDENCY 424
00232 #define MHD_HTTP_UNORDERED_COLLECTION 425
00233 #define MHD_HTTP_UPGRADE_REQUIRED 426
00234 #define MHD_HTTP_NO_RESPONSE 444
00235 #define MHD_HTTP_RETRY_WITH 449
00236 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
00237 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
00238
00239 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
00240 #define MHD_HTTP_NOT_IMPLEMENTED 501
00241 #define MHD_HTTP_BAD_GATEWAY 502
00242 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
00243 #define MHD_HTTP_GATEWAY_TIMEOUT 504
00244 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
00245 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
00246 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
00247 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
00248 #define MHD_HTTP_NOT_EXTENDED 510
00249
00251
00258 #define MHD_ICY_FLAG ((uint32_t)(1 << 31))
00259
00265
00266 #define MHD_HTTP_HEADER_ACCEPT "Accept"
00267 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
00268 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
00269 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
00270 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
00271 #define MHD_HTTP_HEADER_AGE "Age"
00272 #define MHD_HTTP_HEADER_ALLOW "Allow"
00273 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
00274 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
00275 #define MHD_HTTP_HEADER_CONNECTION "Connection"
00276 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
00277 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
00278 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
00279 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
00280 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
00281 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
00282 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
00283 #define MHD_HTTP_HEADER_COOKIE "Cookie"
00284 #define MHD_HTTP_HEADER_DATE "Date"
00285 #define MHD_HTTP_HEADER_ETAG "ETag"
00286 #define MHD_HTTP_HEADER_EXPECT "Expect"
00287 #define MHD_HTTP_HEADER_EXPIRES "Expires"
00288 #define MHD_HTTP_HEADER_FROM "From"
00289 #define MHD_HTTP_HEADER_HOST "Host"
00290 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
00291 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
00292 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
00293 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
00294 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
00295 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
00296 #define MHD_HTTP_HEADER_LOCATION "Location"
00297 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
00298 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
00299 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
00300 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
00301 #define MHD_HTTP_HEADER_RANGE "Range"
00302
00303 #define MHD_HTTP_HEADER_REFERER "Referer"
00304 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
00305 #define MHD_HTTP_HEADER_SERVER "Server"
00306 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
00307 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
00308 #define MHD_HTTP_HEADER_TE "TE"
00309 #define MHD_HTTP_HEADER_TRAILER "Trailer"
00310 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
00311 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
00312 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
00313 #define MHD_HTTP_HEADER_VARY "Vary"
00314 #define MHD_HTTP_HEADER_VIA "Via"
00315 #define MHD_HTTP_HEADER_WARNING "Warning"
00316 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
00317 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin"
00318
00320
00327 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
00328 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
00329
00331
00337 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
00338 #define MHD_HTTP_METHOD_DELETE "DELETE"
00339 #define MHD_HTTP_METHOD_GET "GET"
00340 #define MHD_HTTP_METHOD_HEAD "HEAD"
00341 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
00342 #define MHD_HTTP_METHOD_POST "POST"
00343 #define MHD_HTTP_METHOD_PUT "PUT"
00344 #define MHD_HTTP_METHOD_TRACE "TRACE"
00345
00347
00353 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
00354 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
00355
00357
00358
00363 struct MHD_Daemon;
00364
00373 struct MHD_Connection;
00374
00379 struct MHD_Response;
00380
00385 struct MHD_PostProcessor;
00386
00387
00399 enum MHD_FLAG
00400 {
00404 MHD_NO_FLAG = 0,
00405
00410 MHD_USE_DEBUG = 1,
00411
00415 MHD_USE_SSL = 2,
00416
00420 MHD_USE_THREAD_PER_CONNECTION = 4,
00421
00425 MHD_USE_SELECT_INTERNALLY = 8,
00426
00434 MHD_USE_IPv6 = 16,
00435
00445 MHD_USE_PEDANTIC_CHECKS = 32,
00446
00454 MHD_USE_POLL = 64,
00455
00459 MHD_USE_POLL_INTERNALLY = MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL,
00460
00467 MHD_SUPPRESS_DATE_NO_CLOCK = 128,
00468
00476 MHD_USE_NO_LISTEN_SOCKET = 256,
00477
00483 MHD_USE_EPOLL_LINUX_ONLY = 512,
00484
00490 MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_SELECT_INTERNALLY | MHD_USE_EPOLL_LINUX_ONLY,
00491
00507 MHD_USE_PIPE_FOR_SHUTDOWN = 1024,
00508
00512 MHD_USE_DUAL_STACK = MHD_USE_IPv6 | 2048,
00513
00521 MHD_USE_EPOLL_TURBO = 4096,
00522
00527 MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_PIPE_FOR_SHUTDOWN
00528
00529 };
00530
00531
00540 typedef void (*MHD_LogCallback)(void *cls, const char *fm, va_list ap);
00541
00542
00548 enum MHD_OPTION
00549 {
00550
00555 MHD_OPTION_END = 0,
00556
00564 MHD_OPTION_CONNECTION_MEMORY_LIMIT = 1,
00565
00570 MHD_OPTION_CONNECTION_LIMIT = 2,
00571
00577 MHD_OPTION_CONNECTION_TIMEOUT = 3,
00578
00591 MHD_OPTION_NOTIFY_COMPLETED = 4,
00592
00603 MHD_OPTION_PER_IP_CONNECTION_LIMIT = 5,
00604
00611 MHD_OPTION_SOCK_ADDR = 6,
00612
00639 MHD_OPTION_URI_LOG_CALLBACK = 7,
00640
00647 MHD_OPTION_HTTPS_MEM_KEY = 8,
00648
00655 MHD_OPTION_HTTPS_MEM_CERT = 9,
00656
00662 MHD_OPTION_HTTPS_CRED_TYPE = 10,
00663
00668 MHD_OPTION_HTTPS_PRIORITIES = 11,
00669
00676 MHD_OPTION_LISTEN_SOCKET = 12,
00677
00689 MHD_OPTION_EXTERNAL_LOGGER = 13,
00690
00699 MHD_OPTION_THREAD_POOL_SIZE = 14,
00700
00720 MHD_OPTION_ARRAY = 15,
00721
00740 MHD_OPTION_UNESCAPE_CALLBACK = 16,
00741
00751 MHD_OPTION_DIGEST_AUTH_RANDOM = 17,
00752
00758 MHD_OPTION_NONCE_NC_SIZE = 18,
00759
00764 MHD_OPTION_THREAD_STACK_SIZE = 19,
00765
00771 MHD_OPTION_HTTPS_MEM_TRUST = 20,
00772
00777 MHD_OPTION_CONNECTION_MEMORY_INCREMENT = 21,
00778
00793 MHD_OPTION_HTTPS_CERT_CALLBACK = 22
00794
00795 };
00796
00797
00801 struct MHD_OptionItem
00802 {
00807 enum MHD_OPTION option;
00808
00814 intptr_t value;
00815
00820 void *ptr_value;
00821
00822 };
00823
00824
00829 enum MHD_ValueKind
00830 {
00831
00835 MHD_RESPONSE_HEADER_KIND = 0,
00836
00840 MHD_HEADER_KIND = 1,
00841
00846 MHD_COOKIE_KIND = 2,
00847
00856 MHD_POSTDATA_KIND = 4,
00857
00861 MHD_GET_ARGUMENT_KIND = 8,
00862
00866 MHD_FOOTER_KIND = 16
00867 };
00868
00869
00875 enum MHD_RequestTerminationCode
00876 {
00877
00882 MHD_REQUEST_TERMINATED_COMPLETED_OK = 0,
00883
00890 MHD_REQUEST_TERMINATED_WITH_ERROR = 1,
00891
00898 MHD_REQUEST_TERMINATED_TIMEOUT_REACHED = 2,
00899
00905 MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN = 3,
00906
00915 MHD_REQUEST_TERMINATED_READ_ERROR = 4,
00916
00923 MHD_REQUEST_TERMINATED_CLIENT_ABORT = 5
00924
00925 };
00926
00927
00931 union MHD_ConnectionInfo
00932 {
00933
00937 int cipher_algorithm;
00938
00942 int protocol;
00943
00947 int connect_fd;
00948
00952 void * tls_session;
00953
00957 void * client_cert;
00958
00962 struct sockaddr *client_addr;
00963
00968 struct MHD_Daemon *daemon;
00969 };
00970
00971
00977 enum MHD_ConnectionInfoType
00978 {
00984 MHD_CONNECTION_INFO_CIPHER_ALGO,
00985
00991 MHD_CONNECTION_INFO_PROTOCOL,
00992
01000 MHD_CONNECTION_INFO_CLIENT_ADDRESS,
01001
01006 MHD_CONNECTION_INFO_GNUTLS_SESSION,
01007
01014 MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,
01015
01020 MHD_CONNECTION_INFO_DAEMON,
01021
01027 MHD_CONNECTION_INFO_CONNECTION_FD
01028
01029 };
01030
01031
01036 enum MHD_DaemonInfoType
01037 {
01041 MHD_DAEMON_INFO_KEY_SIZE,
01042
01046 MHD_DAEMON_INFO_MAC_KEY_SIZE,
01047
01052 MHD_DAEMON_INFO_LISTEN_FD,
01053
01058 MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY
01059 };
01060
01061
01072 typedef
01073 void (*MHD_PanicCallback) (void *cls,
01074 const char *file,
01075 unsigned int line,
01076 const char *reason);
01077
01085 typedef int
01086 (*MHD_AcceptPolicyCallback) (void *cls,
01087 const struct sockaddr *addr,
01088 socklen_t addrlen);
01089
01090
01130 typedef int
01131 (*MHD_AccessHandlerCallback) (void *cls,
01132 struct MHD_Connection *connection,
01133 const char *url,
01134 const char *method,
01135 const char *version,
01136 const char *upload_data,
01137 size_t *upload_data_size,
01138 void **con_cls);
01139
01140
01153 typedef void
01154 (*MHD_RequestCompletedCallback) (void *cls,
01155 struct MHD_Connection *connection,
01156 void **con_cls,
01157 enum MHD_RequestTerminationCode toe);
01158
01159
01171 typedef int
01172 (*MHD_KeyValueIterator) (void *cls,
01173 enum MHD_ValueKind kind,
01174 const char *key, const char *value);
01175
01176
01221 typedef ssize_t
01222 (*MHD_ContentReaderCallback) (void *cls,
01223 uint64_t pos,
01224 char *buf,
01225 size_t max);
01226
01227
01237 typedef void
01238 (*MHD_ContentReaderFreeCallback) (void *cls);
01239
01240
01260 typedef int
01261 (*MHD_PostDataIterator) (void *cls,
01262 enum MHD_ValueKind kind,
01263 const char *key,
01264 const char *filename,
01265 const char *content_type,
01266 const char *transfer_encoding,
01267 const char *data,
01268 uint64_t off,
01269 size_t size);
01270
01271
01272
01290 struct MHD_Daemon *
01291 MHD_start_daemon_va (unsigned int flags,
01292 uint16_t port,
01293 MHD_AcceptPolicyCallback apc, void *apc_cls,
01294 MHD_AccessHandlerCallback dh, void *dh_cls,
01295 va_list ap);
01296
01297
01314 struct MHD_Daemon *
01315 MHD_start_daemon (unsigned int flags,
01316 uint16_t port,
01317 MHD_AcceptPolicyCallback apc, void *apc_cls,
01318 MHD_AccessHandlerCallback dh, void *dh_cls,
01319 ...);
01320
01321
01341 int
01342 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
01343
01344
01351 void
01352 MHD_stop_daemon (struct MHD_Daemon *daemon);
01353
01354
01384 int
01385 MHD_add_connection (struct MHD_Daemon *daemon,
01386 int client_socket,
01387 const struct sockaddr *addr,
01388 socklen_t addrlen);
01389
01390
01405 int
01406 MHD_get_fdset (struct MHD_Daemon *daemon,
01407 fd_set *read_fd_set,
01408 fd_set *write_fd_set,
01409 fd_set *except_fd_set,
01410 int *max_fd);
01411
01412
01427 int
01428 MHD_get_timeout (struct MHD_Daemon *daemon,
01429 MHD_UNSIGNED_LONG_LONG *timeout);
01430
01431
01451 int
01452 MHD_run (struct MHD_Daemon *daemon);
01453
01454
01474 int
01475 MHD_run_from_select (struct MHD_Daemon *daemon,
01476 const fd_set *read_fd_set,
01477 const fd_set *write_fd_set,
01478 const fd_set *except_fd_set);
01479
01480
01481
01482
01483
01484
01496 int
01497 MHD_get_connection_values (struct MHD_Connection *connection,
01498 enum MHD_ValueKind kind,
01499 MHD_KeyValueIterator iterator, void *iterator_cls);
01500
01501
01527 int
01528 MHD_set_connection_value (struct MHD_Connection *connection,
01529 enum MHD_ValueKind kind,
01530 const char *key,
01531 const char *value);
01532
01533
01550 void
01551 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
01552
01553
01564 const char *
01565 MHD_lookup_connection_value (struct MHD_Connection *connection,
01566 enum MHD_ValueKind kind,
01567 const char *key);
01568
01569
01581 int
01582 MHD_queue_response (struct MHD_Connection *connection,
01583 unsigned int status_code,
01584 struct MHD_Response *response);
01585
01586
01614 void
01615 MHD_suspend_connection (struct MHD_Connection *connection);
01616
01617
01626 void
01627 MHD_resume_connection (struct MHD_Connection *connection);
01628
01629
01630
01631
01648 struct MHD_Response *
01649 MHD_create_response_from_callback (uint64_t size,
01650 size_t block_size,
01651 MHD_ContentReaderCallback crc, void *crc_cls,
01652 MHD_ContentReaderFreeCallback crfc);
01653
01654
01669 struct MHD_Response *
01670 MHD_create_response_from_data (size_t size,
01671 void *data,
01672 int must_free,
01673 int must_copy);
01674
01675
01681 enum MHD_ResponseMemoryMode
01682 {
01683
01690 MHD_RESPMEM_PERSISTENT,
01691
01698 MHD_RESPMEM_MUST_FREE,
01699
01707 MHD_RESPMEM_MUST_COPY
01708
01709 };
01710
01711
01722 struct MHD_Response *
01723 MHD_create_response_from_buffer (size_t size,
01724 void *buffer,
01725 enum MHD_ResponseMemoryMode mode);
01726
01727
01739 struct MHD_Response *
01740 MHD_create_response_from_fd (size_t size,
01741 int fd);
01742
01743
01760 struct MHD_Response *
01761 MHD_create_response_from_fd_at_offset (size_t size,
01762 int fd,
01763 off_t offset);
01764
01765
01766 #if 0
01767
01772 enum MHD_UpgradeEventMask
01773 {
01774
01779 MHD_UPGRADE_EVENT_TERMINATE = 0,
01780
01785 MHD_UPGRADE_EVENT_READ = 1,
01786
01791 MHD_UPGRADE_EVENT_WRITE = 2,
01792
01800 MHD_UPGRADE_EVENT_EXTERNAL = 4,
01801
01809 MHD_UPGRADE_EVENT_CORK = 8
01810
01811 };
01812
01813
01857 typedef enum MHD_UpgradeEventMask (*MHD_UpgradeHandler)(void *cls,
01858 struct MHD_Connection *connection,
01859 void **con_cls,
01860 size_t *data_in_size,
01861 const char *data_in,
01862 size_t *data_out_size,
01863 char *data_out);
01864
01865
01895 struct MHD_Response *
01896 MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
01897 void *upgrade_handler_cls);
01898 #endif
01899
01909 void
01910 MHD_destroy_response (struct MHD_Response *response);
01911
01912
01923 int
01924 MHD_add_response_header (struct MHD_Response *response,
01925 const char *header,
01926 const char *content);
01927
01928
01938 int
01939 MHD_add_response_footer (struct MHD_Response *response,
01940 const char *footer,
01941 const char *content);
01942
01943
01953 int
01954 MHD_del_response_header (struct MHD_Response *response,
01955 const char *header,
01956 const char *content);
01957
01958
01969 int
01970 MHD_get_response_headers (struct MHD_Response *response,
01971 MHD_KeyValueIterator iterator, void *iterator_cls);
01972
01973
01982 const char *
01983 MHD_get_response_header (struct MHD_Response *response,
01984 const char *key);
01985
01986
01987
01988
02014 struct MHD_PostProcessor *
02015 MHD_create_post_processor (struct MHD_Connection *connection,
02016 size_t buffer_size,
02017 MHD_PostDataIterator iter, void *iter_cls);
02018
02019
02033 int
02034 MHD_post_process (struct MHD_PostProcessor *pp,
02035 const char *post_data, size_t post_data_len);
02036
02037
02048 int
02049 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
02050
02051
02052
02053
02054
02060 #define MHD_INVALID_NONCE -1
02061
02062
02071 char *
02072 MHD_digest_auth_get_username (struct MHD_Connection *connection);
02073
02074
02088 int
02089 MHD_digest_auth_check (struct MHD_Connection *connection,
02090 const char *realm,
02091 const char *username,
02092 const char *password,
02093 unsigned int nonce_timeout);
02094
02095
02110 int
02111 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
02112 const char *realm,
02113 const char *opaque,
02114 struct MHD_Response *response,
02115 int signal_stale);
02116
02117
02127 char *
02128 MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
02129 char** password);
02130
02131
02144 int
02145 MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection,
02146 const char *realm,
02147 struct MHD_Response *response);
02148
02149
02150
02151
02162 const union MHD_ConnectionInfo *
02163 MHD_get_connection_info (struct MHD_Connection *connection,
02164 enum MHD_ConnectionInfoType info_type,
02165 ...);
02166
02167
02172 enum MHD_CONNECTION_OPTION
02173 {
02174
02180 MHD_CONNECTION_OPTION_TIMEOUT
02181
02182 };
02183
02184
02194 int
02195 MHD_set_connection_option (struct MHD_Connection *connection,
02196 enum MHD_CONNECTION_OPTION option,
02197 ...);
02198
02199
02203 union MHD_DaemonInfo
02204 {
02209 size_t key_size;
02210
02215 size_t mac_key_size;
02216
02220 int listen_fd;
02221 };
02222
02223
02235 const union MHD_DaemonInfo *
02236 MHD_get_daemon_info (struct MHD_Daemon *daemon,
02237 enum MHD_DaemonInfoType info_type,
02238 ...);
02239
02240
02247 const char*
02248 MHD_get_version (void);
02249
02250
02251 #if 0
02252 {
02253 #endif
02254 #ifdef __cplusplus
02255 }
02256 #endif
02257
02258 #endif