GNU libmicrohttpd  0.9.29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
microhttpd.h
Go to the documentation of this file.
1 /*
2  This file is part of libmicrohttpd
3  (C) 2006-2014 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 
86 #ifndef MHD_MICROHTTPD_H
87 #define MHD_MICROHTTPD_H
88 
89 #ifdef __cplusplus
90 extern "C"
91 {
92 #if 0 /* keep Emacsens' auto-indent happy */
93 }
94 #endif
95 #endif
96 
97 /* While we generally would like users to use a configure-driven
98  build process which detects which headers are present and
99  hence works on any platform, we use "standard" includes here
100  to build out-of-the-box for beginning users on common systems.
101 
102  Once you have a proper build system and go for more exotic
103  platforms, you should define MHD_PLATFORM_H in some header that
104  you always include *before* "microhttpd.h". Then the following
105  "standard" includes won't be used (which might be a good
106  idea, especially on platforms where they do not exist). */
107 #ifndef MHD_PLATFORM_H
108 #include <stdarg.h>
109 #include <stdint.h>
110 #if defined(_WIN32) && !defined(__CYGWIN__)
111 #include <ws2tcpip.h>
112 #else
113 #include <unistd.h>
114 #include <sys/time.h>
115 #include <sys/types.h>
116 #include <sys/socket.h>
117 #endif
118 #endif
119 
120 #if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
121 /* Do not define __USE_W32_SOCKETS under Cygwin! */
122 #error Cygwin with winsock fd_set is not supported
123 #endif
124 
129 #define MHD_VERSION 0x00093400
130 
134 #define MHD_YES 1
135 
139 #define MHD_NO 0
140 
144 #define MHD_INVALID_NONCE -1
145 
150 #ifdef UINT64_MAX
151 #define MHD_SIZE_UNKNOWN UINT64_MAX
152 #else
153 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
154 #endif
155 
156 #ifdef SIZE_MAX
157 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
158 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
159 #else
160 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
161 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
162 #endif
163 
164 #ifndef _MHD_EXTERN
165 #define _MHD_EXTERN extern
166 #endif
167 
168 #ifndef MHD_SOCKET_DEFINED
169 
172 #if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
173 #define MHD_POSIX_SOCKETS 1
174 typedef int MHD_socket;
175 #define MHD_INVALID_SOCKET (-1)
176 #else /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
177 #define MHD_WINSOCK_SOCKETS 1
178 #include <winsock2.h>
179 typedef SOCKET MHD_socket;
180 #define MHD_INVALID_SOCKET (INVALID_SOCKET)
181 #endif /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
182 #define MHD_SOCKET_DEFINED 1
183 #endif /* MHD_SOCKET_DEFINED */
184 
190 #ifndef MHD_LONG_LONG
191 
194 #define MHD_LONG_LONG long long
195 #define MHD_UNSIGNED_LONG_LONG unsigned long long
196 #endif
197 
201 #ifndef MHD_LONG_LONG_PRINTF
202 
205 #define MHD_LONG_LONG_PRINTF "ll"
206 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
207 #endif
208 
209 
215 #define MHD_HTTP_CONTINUE 100
216 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
217 #define MHD_HTTP_PROCESSING 102
218 
219 #define MHD_HTTP_OK 200
220 #define MHD_HTTP_CREATED 201
221 #define MHD_HTTP_ACCEPTED 202
222 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
223 #define MHD_HTTP_NO_CONTENT 204
224 #define MHD_HTTP_RESET_CONTENT 205
225 #define MHD_HTTP_PARTIAL_CONTENT 206
226 #define MHD_HTTP_MULTI_STATUS 207
227 
228 #define MHD_HTTP_MULTIPLE_CHOICES 300
229 #define MHD_HTTP_MOVED_PERMANENTLY 301
230 #define MHD_HTTP_FOUND 302
231 #define MHD_HTTP_SEE_OTHER 303
232 #define MHD_HTTP_NOT_MODIFIED 304
233 #define MHD_HTTP_USE_PROXY 305
234 #define MHD_HTTP_SWITCH_PROXY 306
235 #define MHD_HTTP_TEMPORARY_REDIRECT 307
236 
237 #define MHD_HTTP_BAD_REQUEST 400
238 #define MHD_HTTP_UNAUTHORIZED 401
239 #define MHD_HTTP_PAYMENT_REQUIRED 402
240 #define MHD_HTTP_FORBIDDEN 403
241 #define MHD_HTTP_NOT_FOUND 404
242 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
243 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE 406
244 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
245 #define MHD_HTTP_REQUEST_TIMEOUT 408
246 #define MHD_HTTP_CONFLICT 409
247 #define MHD_HTTP_GONE 410
248 #define MHD_HTTP_LENGTH_REQUIRED 411
249 #define MHD_HTTP_PRECONDITION_FAILED 412
250 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE 413
251 #define MHD_HTTP_REQUEST_URI_TOO_LONG 414
252 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
253 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE 416
254 #define MHD_HTTP_EXPECTATION_FAILED 417
255 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
256 #define MHD_HTTP_LOCKED 423
257 #define MHD_HTTP_FAILED_DEPENDENCY 424
258 #define MHD_HTTP_UNORDERED_COLLECTION 425
259 #define MHD_HTTP_UPGRADE_REQUIRED 426
260 #define MHD_HTTP_NO_RESPONSE 444
261 #define MHD_HTTP_RETRY_WITH 449
262 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
263 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
264 
265 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
266 #define MHD_HTTP_NOT_IMPLEMENTED 501
267 #define MHD_HTTP_BAD_GATEWAY 502
268 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
269 #define MHD_HTTP_GATEWAY_TIMEOUT 504
270 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
271 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
272 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
273 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
274 #define MHD_HTTP_NOT_EXTENDED 510
275  /* end of group httpcode */
277 
284 #define MHD_ICY_FLAG ((uint32_t)(1 << 31))
285 
291 /* See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html */
292 #define MHD_HTTP_HEADER_ACCEPT "Accept"
293 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
294 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
295 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
296 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
297 #define MHD_HTTP_HEADER_AGE "Age"
298 #define MHD_HTTP_HEADER_ALLOW "Allow"
299 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
300 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
301 #define MHD_HTTP_HEADER_CONNECTION "Connection"
302 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
303 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
304 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
305 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
306 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
307 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
308 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
309 #define MHD_HTTP_HEADER_COOKIE "Cookie"
310 #define MHD_HTTP_HEADER_DATE "Date"
311 #define MHD_HTTP_HEADER_ETAG "ETag"
312 #define MHD_HTTP_HEADER_EXPECT "Expect"
313 #define MHD_HTTP_HEADER_EXPIRES "Expires"
314 #define MHD_HTTP_HEADER_FROM "From"
315 #define MHD_HTTP_HEADER_HOST "Host"
316 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
317 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
318 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
319 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
320 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
321 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
322 #define MHD_HTTP_HEADER_LOCATION "Location"
323 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
324 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
325 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
326 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
327 #define MHD_HTTP_HEADER_RANGE "Range"
328 /* This is not a typo, see HTTP spec */
329 #define MHD_HTTP_HEADER_REFERER "Referer"
330 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
331 #define MHD_HTTP_HEADER_SERVER "Server"
332 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
333 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
334 #define MHD_HTTP_HEADER_TE "TE"
335 #define MHD_HTTP_HEADER_TRAILER "Trailer"
336 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
337 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
338 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
339 #define MHD_HTTP_HEADER_VARY "Vary"
340 #define MHD_HTTP_HEADER_VIA "Via"
341 #define MHD_HTTP_HEADER_WARNING "Warning"
342 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
343 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin"
344  /* end of group headers */
346 
353 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
354 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
355  /* end of group versions */
357 
363 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
364 #define MHD_HTTP_METHOD_DELETE "DELETE"
365 #define MHD_HTTP_METHOD_GET "GET"
366 #define MHD_HTTP_METHOD_HEAD "HEAD"
367 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
368 #define MHD_HTTP_METHOD_POST "POST"
369 #define MHD_HTTP_METHOD_PUT "PUT"
370 #define MHD_HTTP_METHOD_TRACE "TRACE"
371  /* end of group methods */
373 
379 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
380 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
381  /* end of group postenc */
383 
384 
389 struct MHD_Daemon;
390 
399 struct MHD_Connection;
400 
405 struct MHD_Response;
406 
411 struct MHD_PostProcessor;
412 
413 
426 {
431 
437 
442 
447 
452 
461 
472 
481 
486 
494 
503 
510 
517 
535 
540 
549 
555 
562 
563 };
564 
565 
574 typedef void (*MHD_LogCallback)(void *cls, const char *fm, va_list ap);
575 
576 
583 {
584 
590 
599 
605 
612 
626 
638 
646 
674 
682 
690 
697 
703 
711 
724 
734 
755 
775 
786 
793 
799 
806 
812 
828 
837 
838 };
839 
840 
845 {
851 
857  intptr_t value;
858 
863  void *ptr_value;
864 
865 };
866 
867 
873 {
874 
879 
884 
890 
900 
905 
910 };
911 
912 
919 {
920 
926 
934 
942 
949 
959 
967 
968 };
969 
970 
975 {
976 
980  int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
981 
985  int /* enum gnutls_protocol */ protocol;
986 
991 
995  void * /* gnutls_session_t */ tls_session;
996 
1000  void * /* gnutls_x509_crt_t */ client_cert;
1001 
1005  struct sockaddr *client_addr;
1006 
1012 };
1013 
1014 
1021 {
1028 
1035 
1044 
1050 
1058 
1064 
1071 
1072 };
1073 
1074 
1080 {
1085 
1090 
1096 
1102 };
1103 
1104 
1115 typedef
1116  void (*MHD_PanicCallback) (void *cls,
1117  const char *file,
1118  unsigned int line,
1119  const char *reason);
1120 
1128 typedef int
1130  const struct sockaddr *addr,
1131  socklen_t addrlen);
1132 
1133 
1173 typedef int
1175  struct MHD_Connection *connection,
1176  const char *url,
1177  const char *method,
1178  const char *version,
1179  const char *upload_data,
1180  size_t *upload_data_size,
1181  void **con_cls);
1182 
1183 
1196 typedef void
1198  struct MHD_Connection *connection,
1199  void **con_cls,
1200  enum MHD_RequestTerminationCode toe);
1201 
1202 
1214 typedef int
1215  (*MHD_KeyValueIterator) (void *cls,
1216  enum MHD_ValueKind kind,
1217  const char *key, const char *value);
1218 
1219 
1264 typedef ssize_t
1266  uint64_t pos,
1267  char *buf,
1268  size_t max);
1269 
1270 
1280 typedef void
1282 
1283 
1303 typedef int
1304  (*MHD_PostDataIterator) (void *cls,
1305  enum MHD_ValueKind kind,
1306  const char *key,
1307  const char *filename,
1308  const char *content_type,
1309  const char *transfer_encoding,
1310  const char *data,
1311  uint64_t off,
1312  size_t size);
1313 
1314 /* **************** Daemon handling functions ***************** */
1315 
1333 _MHD_EXTERN struct MHD_Daemon *
1334 MHD_start_daemon_va (unsigned int flags,
1335  uint16_t port,
1337  MHD_AccessHandlerCallback dh, void *dh_cls,
1338  va_list ap);
1339 
1340 
1357 _MHD_EXTERN struct MHD_Daemon *
1358 MHD_start_daemon (unsigned int flags,
1359  uint16_t port,
1361  MHD_AccessHandlerCallback dh, void *dh_cls,
1362  ...);
1363 
1364 
1385 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
1386 
1387 
1394 _MHD_EXTERN void
1395 MHD_stop_daemon (struct MHD_Daemon *daemon);
1396 
1397 
1427 _MHD_EXTERN int
1428 MHD_add_connection (struct MHD_Daemon *daemon,
1429  MHD_socket client_socket,
1430  const struct sockaddr *addr,
1431  socklen_t addrlen);
1432 
1433 
1451 _MHD_EXTERN int
1452 MHD_get_fdset (struct MHD_Daemon *daemon,
1453  fd_set *read_fd_set,
1454  fd_set *write_fd_set,
1455  fd_set *except_fd_set,
1456  MHD_socket *max_fd);
1457 
1458 
1473 _MHD_EXTERN int
1474 MHD_get_timeout (struct MHD_Daemon *daemon,
1475  MHD_UNSIGNED_LONG_LONG *timeout);
1476 
1477 
1497 _MHD_EXTERN int
1498 MHD_run (struct MHD_Daemon *daemon);
1499 
1500 
1520 _MHD_EXTERN int
1521 MHD_run_from_select (struct MHD_Daemon *daemon,
1522  const fd_set *read_fd_set,
1523  const fd_set *write_fd_set,
1524  const fd_set *except_fd_set);
1525 
1526 
1527 
1528 
1529 /* **************** Connection handling functions ***************** */
1530 
1542 _MHD_EXTERN int
1543 MHD_get_connection_values (struct MHD_Connection *connection,
1544  enum MHD_ValueKind kind,
1545  MHD_KeyValueIterator iterator, void *iterator_cls);
1546 
1547 
1573 _MHD_EXTERN int
1574 MHD_set_connection_value (struct MHD_Connection *connection,
1575  enum MHD_ValueKind kind,
1576  const char *key,
1577  const char *value);
1578 
1579 
1596 _MHD_EXTERN void
1597 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
1598 
1599 
1610 _MHD_EXTERN const char *
1611 MHD_lookup_connection_value (struct MHD_Connection *connection,
1612  enum MHD_ValueKind kind,
1613  const char *key);
1614 
1615 
1627 _MHD_EXTERN int
1628 MHD_queue_response (struct MHD_Connection *connection,
1629  unsigned int status_code,
1630  struct MHD_Response *response);
1631 
1632 
1660 _MHD_EXTERN void
1661 MHD_suspend_connection (struct MHD_Connection *connection);
1662 
1663 
1672 _MHD_EXTERN void
1673 MHD_resume_connection (struct MHD_Connection *connection);
1674 
1675 
1676 /* **************** Response manipulation functions ***************** */
1677 
1694 _MHD_EXTERN struct MHD_Response *
1695 MHD_create_response_from_callback (uint64_t size,
1696  size_t block_size,
1699 
1700 
1715 _MHD_EXTERN struct MHD_Response *
1716 MHD_create_response_from_data (size_t size,
1717  void *data,
1718  int must_free,
1719  int must_copy);
1720 
1721 
1728 {
1729 
1737 
1745 
1754 
1755 };
1756 
1757 
1768 _MHD_EXTERN struct MHD_Response *
1769 MHD_create_response_from_buffer (size_t size,
1770  void *buffer,
1771  enum MHD_ResponseMemoryMode mode);
1772 
1773 
1785 _MHD_EXTERN struct MHD_Response *
1786 MHD_create_response_from_fd (size_t size,
1787  int fd);
1788 
1789 
1806 _MHD_EXTERN struct MHD_Response *
1808  int fd,
1809  off_t offset);
1810 
1811 
1812 #if 0
1813 
1818 enum MHD_UpgradeEventMask
1819 {
1820 
1825  MHD_UPGRADE_EVENT_TERMINATE = 0,
1826 
1831  MHD_UPGRADE_EVENT_READ = 1,
1832 
1837  MHD_UPGRADE_EVENT_WRITE = 2,
1838 
1846  MHD_UPGRADE_EVENT_EXTERNAL = 4,
1847 
1855  MHD_UPGRADE_EVENT_CORK = 8
1856 
1857 };
1858 
1859 
1903 typedef enum MHD_UpgradeEventMask (*MHD_UpgradeHandler)(void *cls,
1904  struct MHD_Connection *connection,
1905  void **con_cls,
1906  size_t *data_in_size,
1907  const char *data_in,
1908  size_t *data_out_size,
1909  char *data_out);
1910 
1911 
1941 struct MHD_Response *
1942 MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
1943  void *upgrade_handler_cls);
1944 #endif
1945 
1955 _MHD_EXTERN void
1956 MHD_destroy_response (struct MHD_Response *response);
1957 
1958 
1969 _MHD_EXTERN int
1970 MHD_add_response_header (struct MHD_Response *response,
1971  const char *header,
1972  const char *content);
1973 
1974 
1984 _MHD_EXTERN int
1985 MHD_add_response_footer (struct MHD_Response *response,
1986  const char *footer,
1987  const char *content);
1988 
1989 
1999 _MHD_EXTERN int
2000 MHD_del_response_header (struct MHD_Response *response,
2001  const char *header,
2002  const char *content);
2003 
2004 
2015 _MHD_EXTERN int
2016 MHD_get_response_headers (struct MHD_Response *response,
2017  MHD_KeyValueIterator iterator, void *iterator_cls);
2018 
2019 
2028 _MHD_EXTERN const char *
2029 MHD_get_response_header (struct MHD_Response *response,
2030  const char *key);
2031 
2032 
2033 /* ********************** PostProcessor functions ********************** */
2034 
2060 _MHD_EXTERN struct MHD_PostProcessor *
2061 MHD_create_post_processor (struct MHD_Connection *connection,
2062  size_t buffer_size,
2063  MHD_PostDataIterator iter, void *iter_cls);
2064 
2065 
2079 _MHD_EXTERN int
2080 MHD_post_process (struct MHD_PostProcessor *pp,
2081  const char *post_data, size_t post_data_len);
2082 
2083 
2094 _MHD_EXTERN int
2095 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
2096 
2097 
2098 /* ********************* Digest Authentication functions *************** */
2099 
2100 
2106 #define MHD_INVALID_NONCE -1
2107 
2108 
2117 _MHD_EXTERN char *
2118 MHD_digest_auth_get_username (struct MHD_Connection *connection);
2119 
2120 
2134 _MHD_EXTERN int
2135 MHD_digest_auth_check (struct MHD_Connection *connection,
2136  const char *realm,
2137  const char *username,
2138  const char *password,
2139  unsigned int nonce_timeout);
2140 
2141 
2156 _MHD_EXTERN int
2157 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
2158  const char *realm,
2159  const char *opaque,
2160  struct MHD_Response *response,
2161  int signal_stale);
2162 
2163 
2173 _MHD_EXTERN char *
2175  char** password);
2176 
2177 
2190 _MHD_EXTERN int
2192  const char *realm,
2193  struct MHD_Response *response);
2194 
2195 /* ********************** generic query functions ********************** */
2196 
2197 
2208 _MHD_EXTERN const union MHD_ConnectionInfo *
2209 MHD_get_connection_info (struct MHD_Connection *connection,
2210  enum MHD_ConnectionInfoType info_type,
2211  ...);
2212 
2213 
2219 {
2220 
2227 
2228 };
2229 
2230 
2240 _MHD_EXTERN int
2241 MHD_set_connection_option (struct MHD_Connection *connection,
2242  enum MHD_CONNECTION_OPTION option,
2243  ...);
2244 
2245 
2250 {
2255  size_t key_size;
2256 
2262 
2267 };
2268 
2269 
2281 _MHD_EXTERN const union MHD_DaemonInfo *
2282 MHD_get_daemon_info (struct MHD_Daemon *daemon,
2283  enum MHD_DaemonInfoType info_type,
2284  ...);
2285 
2286 
2293 _MHD_EXTERN const char*
2294 MHD_get_version (void);
2295 
2296 
2297 #if 0 /* keep Emacsens' auto-indent happy */
2298 {
2299 #endif
2300 #ifdef __cplusplus
2301 }
2302 #endif
2303 
2304 #endif
int(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: microhttpd.h:1215
_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:3213
_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:231
_MHD_EXTERN const char * MHD_get_version(void)
Definition: daemon.c:4168
size_t mac_key_size
Definition: microhttpd.h:2261
_MHD_EXTERN const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
Definition: connection.c:210
MHD_socket listen_fd
Definition: microhttpd.h:2266
_MHD_EXTERN int MHD_add_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:90
MHD_ContentReaderFreeCallback crfc
Definition: internal.h:284
_MHD_EXTERN int MHD_get_timeout(struct MHD_Daemon *daemon, MHD_UNSIGNED_LONG_LONG *timeout)
Definition: daemon.c:1868
char * version
Definition: internal.h:602
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:1281
_MHD_EXTERN int MHD_add_connection(struct MHD_Daemon *daemon, MHD_socket client_socket, const struct sockaddr *addr, socklen_t addrlen)
Definition: daemon.c:1674
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd_at_offset(size_t size, int fd, off_t offset)
Definition: response.c:320
_MHD_EXTERN int MHD_queue_basic_auth_fail_response(struct MHD_Connection *connection, const char *realm, struct MHD_Response *response)
Definition: basicauth.c:116
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
Definition: microhttpd.h:1197
MHD_RequestTerminationCode
Definition: microhttpd.h:918
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:1304
_MHD_EXTERN int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
MHD_socket connect_fd
Definition: microhttpd.h:990
_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:548
int MHD_socket
Definition: microhttpd.h:174
_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:2671
intptr_t value
Definition: microhttpd.h:857
_MHD_EXTERN void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
Definition: daemon.c:4154
#define MHD_UNSIGNED_LONG_LONG
Definition: microhttpd.h:195
_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 const union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:2724
MHD_CONNECTION_OPTION
Definition: microhttpd.h:2218
_MHD_EXTERN char * MHD_basic_auth_get_username_password(struct MHD_Connection *connection, char **password)
Definition: basicauth.c:46
_MHD_EXTERN void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:3963
_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:760
_MHD_EXTERN int MHD_add_response_footer(struct MHD_Response *response, const char *footer, const char *content)
Definition: response.c:110
char * method
Definition: internal.h:590
#define _MHD_EXTERN
Definition: microhttpd.h:165
_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:1958
_MHD_EXTERN char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
Definition: digestauth.c:354
_MHD_EXTERN void MHD_destroy_response(struct MHD_Response *response)
Definition: response.c:444
_MHD_EXTERN void MHD_suspend_connection(struct MHD_Connection *connection)
Definition: daemon.c:1427
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:1129
_MHD_EXTERN int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:2767
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:1265
uint16_t port
Definition: internal.h:1149
MHD_ValueKind
Definition: microhttpd.h:872
char * url
Definition: internal.h:596
struct MHD_Daemon * daemon
Definition: microhttpd.h:1011
_MHD_EXTERN int MHD_post_process(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
MHD_ConnectionInfoType
Definition: microhttpd.h:1020
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
Definition: response.c:350
_MHD_EXTERN int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:2822
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_buffer(size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
Definition: response.c:423
MHD_AcceptPolicyCallback apc
Definition: internal.h:982
_MHD_EXTERN int MHD_get_fdset(struct MHD_Daemon *daemon, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, MHD_socket *max_fd)
Definition: daemon.c:606
void * ptr_value
Definition: microhttpd.h:863
_MHD_EXTERN int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: connection.c:121
_MHD_EXTERN int MHD_run(struct MHD_Daemon *daemon)
Definition: daemon.c:2599
MHD_OPTION
MHD options.
Definition: microhttpd.h:582
void * apc_cls
Definition: internal.h:987
MHD_ContentReaderCallback crc
Definition: internal.h:278
void * crc_cls
Definition: internal.h:272
MHD_DaemonInfoType
Definition: microhttpd.h:1079
struct sockaddr * client_addr
Definition: microhttpd.h:1005
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:1174
_MHD_EXTERN int MHD_del_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:130
_MHD_EXTERN struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
Definition: response.c:372
_MHD_EXTERN const char * MHD_get_response_header(struct MHD_Response *response, const char *key)
Definition: response.c:200
_MHD_EXTERN MHD_socket MHD_quiesce_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:2707
_MHD_EXTERN const union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
Definition: daemon.c:4115
enum MHD_OPTION option
Definition: microhttpd.h:850
_MHD_EXTERN int MHD_set_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: connection.c:170
MHD_FLAG
Flags for the struct MHD_Daemon.
Definition: microhttpd.h:425
_MHD_EXTERN int MHD_get_response_headers(struct MHD_Response *response, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: response.c:173
void(* MHD_LogCallback)(void *cls, const char *fm, va_list ap)
Definition: microhttpd.h:574
MHD_ResponseMemoryMode
Definition: microhttpd.h:1727
_MHD_EXTERN void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:1488
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:1116