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-2013 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 <unistd.h>
109 #include <stdarg.h>
110 #include <stdint.h>
111 #ifdef __MINGW32__
112 #include <ws2tcpip.h>
113 #else
114 #include <sys/time.h>
115 #include <sys/types.h>
116 #include <sys/socket.h>
117 #endif
118 #endif
119 
124 #define MHD_VERSION 0x00093300
125 
129 #define MHD_YES 1
130 
134 #define MHD_NO 0
135 
139 #define MHD_INVALID_NONCE -1
140 
145 #ifdef UINT64_MAX
146 #define MHD_SIZE_UNKNOWN UINT64_MAX
147 #else
148 #define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
149 #endif
150 
151 #ifdef SIZE_MAX
152 #define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
153 #define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
154 #else
155 #define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
156 #define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
157 #endif
158 
164 #ifndef MHD_LONG_LONG
165 
168 #define MHD_LONG_LONG long long
169 #define MHD_UNSIGNED_LONG_LONG unsigned long long
170 #endif
171 
175 #ifndef MHD_LONG_LONG_PRINTF
176 
179 #define MHD_LONG_LONG_PRINTF "ll"
180 #define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
181 #endif
182 
183 
189 #define MHD_HTTP_CONTINUE 100
190 #define MHD_HTTP_SWITCHING_PROTOCOLS 101
191 #define MHD_HTTP_PROCESSING 102
192 
193 #define MHD_HTTP_OK 200
194 #define MHD_HTTP_CREATED 201
195 #define MHD_HTTP_ACCEPTED 202
196 #define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
197 #define MHD_HTTP_NO_CONTENT 204
198 #define MHD_HTTP_RESET_CONTENT 205
199 #define MHD_HTTP_PARTIAL_CONTENT 206
200 #define MHD_HTTP_MULTI_STATUS 207
201 
202 #define MHD_HTTP_MULTIPLE_CHOICES 300
203 #define MHD_HTTP_MOVED_PERMANENTLY 301
204 #define MHD_HTTP_FOUND 302
205 #define MHD_HTTP_SEE_OTHER 303
206 #define MHD_HTTP_NOT_MODIFIED 304
207 #define MHD_HTTP_USE_PROXY 305
208 #define MHD_HTTP_SWITCH_PROXY 306
209 #define MHD_HTTP_TEMPORARY_REDIRECT 307
210 
211 #define MHD_HTTP_BAD_REQUEST 400
212 #define MHD_HTTP_UNAUTHORIZED 401
213 #define MHD_HTTP_PAYMENT_REQUIRED 402
214 #define MHD_HTTP_FORBIDDEN 403
215 #define MHD_HTTP_NOT_FOUND 404
216 #define MHD_HTTP_METHOD_NOT_ALLOWED 405
217 #define MHD_HTTP_METHOD_NOT_ACCEPTABLE 406
218 #define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
219 #define MHD_HTTP_REQUEST_TIMEOUT 408
220 #define MHD_HTTP_CONFLICT 409
221 #define MHD_HTTP_GONE 410
222 #define MHD_HTTP_LENGTH_REQUIRED 411
223 #define MHD_HTTP_PRECONDITION_FAILED 412
224 #define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE 413
225 #define MHD_HTTP_REQUEST_URI_TOO_LONG 414
226 #define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
227 #define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE 416
228 #define MHD_HTTP_EXPECTATION_FAILED 417
229 #define MHD_HTTP_UNPROCESSABLE_ENTITY 422
230 #define MHD_HTTP_LOCKED 423
231 #define MHD_HTTP_FAILED_DEPENDENCY 424
232 #define MHD_HTTP_UNORDERED_COLLECTION 425
233 #define MHD_HTTP_UPGRADE_REQUIRED 426
234 #define MHD_HTTP_NO_RESPONSE 444
235 #define MHD_HTTP_RETRY_WITH 449
236 #define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
237 #define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
238 
239 #define MHD_HTTP_INTERNAL_SERVER_ERROR 500
240 #define MHD_HTTP_NOT_IMPLEMENTED 501
241 #define MHD_HTTP_BAD_GATEWAY 502
242 #define MHD_HTTP_SERVICE_UNAVAILABLE 503
243 #define MHD_HTTP_GATEWAY_TIMEOUT 504
244 #define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
245 #define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
246 #define MHD_HTTP_INSUFFICIENT_STORAGE 507
247 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
248 #define MHD_HTTP_NOT_EXTENDED 510
249  /* end of group httpcode */
251 
258 #define MHD_ICY_FLAG ((uint32_t)(1 << 31))
259 
265 /* See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html */
266 #define MHD_HTTP_HEADER_ACCEPT "Accept"
267 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
268 #define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
269 #define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
270 #define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
271 #define MHD_HTTP_HEADER_AGE "Age"
272 #define MHD_HTTP_HEADER_ALLOW "Allow"
273 #define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
274 #define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
275 #define MHD_HTTP_HEADER_CONNECTION "Connection"
276 #define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
277 #define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
278 #define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
279 #define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
280 #define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
281 #define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
282 #define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
283 #define MHD_HTTP_HEADER_COOKIE "Cookie"
284 #define MHD_HTTP_HEADER_DATE "Date"
285 #define MHD_HTTP_HEADER_ETAG "ETag"
286 #define MHD_HTTP_HEADER_EXPECT "Expect"
287 #define MHD_HTTP_HEADER_EXPIRES "Expires"
288 #define MHD_HTTP_HEADER_FROM "From"
289 #define MHD_HTTP_HEADER_HOST "Host"
290 #define MHD_HTTP_HEADER_IF_MATCH "If-Match"
291 #define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
292 #define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
293 #define MHD_HTTP_HEADER_IF_RANGE "If-Range"
294 #define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
295 #define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
296 #define MHD_HTTP_HEADER_LOCATION "Location"
297 #define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
298 #define MHD_HTTP_HEADER_PRAGMA "Pragma"
299 #define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
300 #define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
301 #define MHD_HTTP_HEADER_RANGE "Range"
302 /* This is not a typo, see HTTP spec */
303 #define MHD_HTTP_HEADER_REFERER "Referer"
304 #define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
305 #define MHD_HTTP_HEADER_SERVER "Server"
306 #define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
307 #define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
308 #define MHD_HTTP_HEADER_TE "TE"
309 #define MHD_HTTP_HEADER_TRAILER "Trailer"
310 #define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
311 #define MHD_HTTP_HEADER_UPGRADE "Upgrade"
312 #define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
313 #define MHD_HTTP_HEADER_VARY "Vary"
314 #define MHD_HTTP_HEADER_VIA "Via"
315 #define MHD_HTTP_HEADER_WARNING "Warning"
316 #define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
317 #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin"
318  /* end of group headers */
320 
327 #define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
328 #define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
329  /* end of group versions */
331 
337 #define MHD_HTTP_METHOD_CONNECT "CONNECT"
338 #define MHD_HTTP_METHOD_DELETE "DELETE"
339 #define MHD_HTTP_METHOD_GET "GET"
340 #define MHD_HTTP_METHOD_HEAD "HEAD"
341 #define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
342 #define MHD_HTTP_METHOD_POST "POST"
343 #define MHD_HTTP_METHOD_PUT "PUT"
344 #define MHD_HTTP_METHOD_TRACE "TRACE"
345  /* end of group methods */
347 
353 #define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
354 #define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
355  /* end of group postenc */
357 
358 
363 struct MHD_Daemon;
364 
373 struct MHD_Connection;
374 
379 struct MHD_Response;
380 
385 struct MHD_PostProcessor;
386 
387 
400 {
405 
411 
416 
421 
426 
435 
446 
455 
460 
468 
477 
484 
491 
508 
513 
522 
528 
529 };
530 
531 
540 typedef void (*MHD_LogCallback)(void *cls, const char *fm, va_list ap);
541 
542 
549 {
550 
556 
565 
571 
578 
592 
604 
612 
640 
648 
656 
663 
669 
677 
690 
700 
721 
741 
752 
759 
765 
772 
778 
794 
795 };
796 
797 
802 {
808 
814  intptr_t value;
815 
820  void *ptr_value;
821 
822 };
823 
824 
830 {
831 
836 
841 
847 
857 
862 
867 };
868 
869 
876 {
877 
883 
891 
899 
906 
916 
924 
925 };
926 
927 
932 {
933 
937  int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
938 
942  int /* enum gnutls_protocol */ protocol;
943 
948 
952  void * /* gnutls_session_t */ tls_session;
953 
957  void * /* gnutls_x509_crt_t */ client_cert;
958 
962  struct sockaddr *client_addr;
963 
969 };
970 
971 
978 {
985 
992 
1001 
1007 
1015 
1021 
1028 
1029 };
1030 
1031 
1037 {
1042 
1047 
1053 
1059 };
1060 
1061 
1072 typedef
1073  void (*MHD_PanicCallback) (void *cls,
1074  const char *file,
1075  unsigned int line,
1076  const char *reason);
1077 
1085 typedef int
1087  const struct sockaddr *addr,
1088  socklen_t addrlen);
1089 
1090 
1130 typedef int
1132  struct MHD_Connection *connection,
1133  const char *url,
1134  const char *method,
1135  const char *version,
1136  const char *upload_data,
1137  size_t *upload_data_size,
1138  void **con_cls);
1139 
1140 
1153 typedef void
1155  struct MHD_Connection *connection,
1156  void **con_cls,
1157  enum MHD_RequestTerminationCode toe);
1158 
1159 
1171 typedef int
1172  (*MHD_KeyValueIterator) (void *cls,
1173  enum MHD_ValueKind kind,
1174  const char *key, const char *value);
1175 
1176 
1221 typedef ssize_t
1223  uint64_t pos,
1224  char *buf,
1225  size_t max);
1226 
1227 
1237 typedef void
1239 
1240 
1260 typedef int
1261  (*MHD_PostDataIterator) (void *cls,
1262  enum MHD_ValueKind kind,
1263  const char *key,
1264  const char *filename,
1265  const char *content_type,
1266  const char *transfer_encoding,
1267  const char *data,
1268  uint64_t off,
1269  size_t size);
1270 
1271 /* **************** Daemon handling functions ***************** */
1272 
1290 struct MHD_Daemon *
1291 MHD_start_daemon_va (unsigned int flags,
1292  uint16_t port,
1294  MHD_AccessHandlerCallback dh, void *dh_cls,
1295  va_list ap);
1296 
1297 
1314 struct MHD_Daemon *
1315 MHD_start_daemon (unsigned int flags,
1316  uint16_t port,
1318  MHD_AccessHandlerCallback dh, void *dh_cls,
1319  ...);
1320 
1321 
1341 int
1342 MHD_quiesce_daemon (struct MHD_Daemon *daemon);
1343 
1344 
1351 void
1352 MHD_stop_daemon (struct MHD_Daemon *daemon);
1353 
1354 
1384 int
1385 MHD_add_connection (struct MHD_Daemon *daemon,
1386  int client_socket,
1387  const struct sockaddr *addr,
1388  socklen_t addrlen);
1389 
1390 
1405 int
1406 MHD_get_fdset (struct MHD_Daemon *daemon,
1407  fd_set *read_fd_set,
1408  fd_set *write_fd_set,
1409  fd_set *except_fd_set,
1410  int *max_fd);
1411 
1412 
1427 int
1428 MHD_get_timeout (struct MHD_Daemon *daemon,
1429  MHD_UNSIGNED_LONG_LONG *timeout);
1430 
1431 
1451 int
1452 MHD_run (struct MHD_Daemon *daemon);
1453 
1454 
1474 int
1475 MHD_run_from_select (struct MHD_Daemon *daemon,
1476  const fd_set *read_fd_set,
1477  const fd_set *write_fd_set,
1478  const fd_set *except_fd_set);
1479 
1480 
1481 
1482 
1483 /* **************** Connection handling functions ***************** */
1484 
1496 int
1497 MHD_get_connection_values (struct MHD_Connection *connection,
1498  enum MHD_ValueKind kind,
1499  MHD_KeyValueIterator iterator, void *iterator_cls);
1500 
1501 
1527 int
1528 MHD_set_connection_value (struct MHD_Connection *connection,
1529  enum MHD_ValueKind kind,
1530  const char *key,
1531  const char *value);
1532 
1533 
1550 void
1551 MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
1552 
1553 
1564 const char *
1565 MHD_lookup_connection_value (struct MHD_Connection *connection,
1566  enum MHD_ValueKind kind,
1567  const char *key);
1568 
1569 
1581 int
1582 MHD_queue_response (struct MHD_Connection *connection,
1583  unsigned int status_code,
1584  struct MHD_Response *response);
1585 
1586 
1614 void
1615 MHD_suspend_connection (struct MHD_Connection *connection);
1616 
1617 
1626 void
1627 MHD_resume_connection (struct MHD_Connection *connection);
1628 
1629 
1630 /* **************** Response manipulation functions ***************** */
1631 
1648 struct MHD_Response *
1649 MHD_create_response_from_callback (uint64_t size,
1650  size_t block_size,
1653 
1654 
1669 struct MHD_Response *
1670 MHD_create_response_from_data (size_t size,
1671  void *data,
1672  int must_free,
1673  int must_copy);
1674 
1675 
1682 {
1683 
1691 
1699 
1708 
1709 };
1710 
1711 
1722 struct MHD_Response *
1723 MHD_create_response_from_buffer (size_t size,
1724  void *buffer,
1725  enum MHD_ResponseMemoryMode mode);
1726 
1727 
1739 struct MHD_Response *
1740 MHD_create_response_from_fd (size_t size,
1741  int fd);
1742 
1743 
1760 struct MHD_Response *
1762  int fd,
1763  off_t offset);
1764 
1765 
1766 #if 0
1767 
1772 enum MHD_UpgradeEventMask
1773 {
1774 
1779  MHD_UPGRADE_EVENT_TERMINATE = 0,
1780 
1785  MHD_UPGRADE_EVENT_READ = 1,
1786 
1791  MHD_UPGRADE_EVENT_WRITE = 2,
1792 
1800  MHD_UPGRADE_EVENT_EXTERNAL = 4,
1801 
1809  MHD_UPGRADE_EVENT_CORK = 8
1810 
1811 };
1812 
1813 
1857 typedef enum MHD_UpgradeEventMask (*MHD_UpgradeHandler)(void *cls,
1858  struct MHD_Connection *connection,
1859  void **con_cls,
1860  size_t *data_in_size,
1861  const char *data_in,
1862  size_t *data_out_size,
1863  char *data_out);
1864 
1865 
1895 struct MHD_Response *
1896 MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
1897  void *upgrade_handler_cls);
1898 #endif
1899 
1909 void
1910 MHD_destroy_response (struct MHD_Response *response);
1911 
1912 
1923 int
1924 MHD_add_response_header (struct MHD_Response *response,
1925  const char *header,
1926  const char *content);
1927 
1928 
1938 int
1939 MHD_add_response_footer (struct MHD_Response *response,
1940  const char *footer,
1941  const char *content);
1942 
1943 
1953 int
1954 MHD_del_response_header (struct MHD_Response *response,
1955  const char *header,
1956  const char *content);
1957 
1958 
1969 int
1970 MHD_get_response_headers (struct MHD_Response *response,
1971  MHD_KeyValueIterator iterator, void *iterator_cls);
1972 
1973 
1982 const char *
1983 MHD_get_response_header (struct MHD_Response *response,
1984  const char *key);
1985 
1986 
1987 /* ********************** PostProcessor functions ********************** */
1988 
2014 struct MHD_PostProcessor *
2015 MHD_create_post_processor (struct MHD_Connection *connection,
2016  size_t buffer_size,
2017  MHD_PostDataIterator iter, void *iter_cls);
2018 
2019 
2033 int
2034 MHD_post_process (struct MHD_PostProcessor *pp,
2035  const char *post_data, size_t post_data_len);
2036 
2037 
2048 int
2049 MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
2050 
2051 
2052 /* ********************* Digest Authentication functions *************** */
2053 
2054 
2060 #define MHD_INVALID_NONCE -1
2061 
2062 
2071 char *
2072 MHD_digest_auth_get_username (struct MHD_Connection *connection);
2073 
2074 
2088 int
2089 MHD_digest_auth_check (struct MHD_Connection *connection,
2090  const char *realm,
2091  const char *username,
2092  const char *password,
2093  unsigned int nonce_timeout);
2094 
2095 
2110 int
2111 MHD_queue_auth_fail_response (struct MHD_Connection *connection,
2112  const char *realm,
2113  const char *opaque,
2114  struct MHD_Response *response,
2115  int signal_stale);
2116 
2117 
2127 char *
2129  char** password);
2130 
2131 
2144 int
2146  const char *realm,
2147  struct MHD_Response *response);
2148 
2149 /* ********************** generic query functions ********************** */
2150 
2151 
2162 const union MHD_ConnectionInfo *
2163 MHD_get_connection_info (struct MHD_Connection *connection,
2164  enum MHD_ConnectionInfoType info_type,
2165  ...);
2166 
2167 
2173 {
2174 
2181 
2182 };
2183 
2184 
2194 int
2195 MHD_set_connection_option (struct MHD_Connection *connection,
2196  enum MHD_CONNECTION_OPTION option,
2197  ...);
2198 
2199 
2204 {
2209  size_t key_size;
2210 
2216 
2221 };
2222 
2223 
2235 const union MHD_DaemonInfo *
2236 MHD_get_daemon_info (struct MHD_Daemon *daemon,
2237  enum MHD_DaemonInfoType info_type,
2238  ...);
2239 
2240 
2247 const char*
2248 MHD_get_version (void);
2249 
2250 
2251 #if 0 /* keep Emacsens' auto-indent happy */
2252 {
2253 #endif
2254 #ifdef __cplusplus
2255 }
2256 #endif
2257 
2258 #endif
int(* MHD_KeyValueIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
Definition: microhttpd.h:1172
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:3184
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
const char * MHD_get_version(void)
Definition: daemon.c:4134
size_t mac_key_size
Definition: microhttpd.h:2215
const char * MHD_lookup_connection_value(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key)
Definition: connection.c:210
union MHD_DaemonInfo * MHD_get_daemon_info(struct MHD_Daemon *daemon, enum MHD_DaemonInfoType info_type,...)
Definition: daemon.c:4081
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:279
int MHD_get_timeout(struct MHD_Daemon *daemon, MHD_UNSIGNED_LONG_LONG *timeout)
Definition: daemon.c:1854
void MHD_resume_connection(struct MHD_Connection *connection)
Definition: daemon.c:1464
char * version
Definition: internal.h:597
void(* MHD_ContentReaderFreeCallback)(void *cls)
Definition: microhttpd.h:1238
struct MHD_Response * MHD_create_response_from_fd_at_offset(size_t size, int fd, off_t offset)
Definition: response.c:320
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:1154
MHD_RequestTerminationCode
Definition: microhttpd.h:875
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:1261
int MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
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
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:2656
intptr_t value
Definition: microhttpd.h:814
void MHD_set_panic_func(MHD_PanicCallback cb, void *cls)
Definition: daemon.c:4120
#define MHD_UNSIGNED_LONG_LONG
Definition: microhttpd.h:169
struct MHD_PostProcessor * MHD_create_post_processor(struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iter, void *iter_cls)
MHD_CONNECTION_OPTION
Definition: microhttpd.h:2172
char * MHD_basic_auth_get_username_password(struct MHD_Connection *connection, char **password)
Definition: basicauth.c:46
union MHD_ConnectionInfo * MHD_get_connection_info(struct MHD_Connection *connection, enum MHD_ConnectionInfoType info_type,...)
Definition: connection.c:2618
void MHD_stop_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:3929
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
int MHD_add_response_footer(struct MHD_Response *response, const char *footer, const char *content)
Definition: response.c:110
char * method
Definition: internal.h:585
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:1943
char * MHD_digest_auth_get_username(struct MHD_Connection *connection)
Definition: digestauth.c:354
void MHD_destroy_response(struct MHD_Response *response)
Definition: response.c:444
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
Definition: microhttpd.h:1086
int MHD_set_connection_option(struct MHD_Connection *connection, enum MHD_CONNECTION_OPTION option,...)
Definition: connection.c:2661
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
Definition: microhttpd.h:1222
uint16_t port
Definition: internal.h:1143
MHD_ValueKind
Definition: microhttpd.h:829
char * url
Definition: internal.h:591
struct MHD_Daemon * daemon
Definition: microhttpd.h:968
int MHD_post_process(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
MHD_ConnectionInfoType
Definition: microhttpd.h:977
struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd)
Definition: response.c:350
int MHD_queue_response(struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response)
Definition: connection.c:2716
int MHD_quiesce_daemon(struct MHD_Daemon *daemon)
Definition: daemon.c:2692
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:977
void * ptr_value
Definition: microhttpd.h:820
int MHD_get_connection_values(struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
Definition: connection.c:121
int MHD_run(struct MHD_Daemon *daemon)
Definition: daemon.c:2584
MHD_OPTION
MHD options.
Definition: microhttpd.h:548
int MHD_get_fdset(struct MHD_Daemon *daemon, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, int *max_fd)
Definition: daemon.c:583
void * apc_cls
Definition: internal.h:982
MHD_ContentReaderCallback crc
Definition: internal.h:273
void * crc_cls
Definition: internal.h:267
MHD_DaemonInfoType
Definition: microhttpd.h:1036
struct sockaddr * client_addr
Definition: microhttpd.h:962
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:1131
int MHD_add_connection(struct MHD_Daemon *daemon, int client_socket, const struct sockaddr *addr, socklen_t addrlen)
Definition: daemon.c:1662
int MHD_del_response_header(struct MHD_Response *response, const char *header, const char *content)
Definition: response.c:130
struct MHD_Response * MHD_create_response_from_data(size_t size, void *data, int must_free, int must_copy)
Definition: response.c:372
void MHD_suspend_connection(struct MHD_Connection *connection)
Definition: daemon.c:1403
const char * MHD_get_response_header(struct MHD_Response *response, const char *key)
Definition: response.c:200
enum MHD_OPTION option
Definition: microhttpd.h:807
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:399
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:540
MHD_ResponseMemoryMode
Definition: microhttpd.h:1681
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)
Definition: microhttpd.h:1073