aboutsummaryrefslogtreecommitdiff
path: root/src/include/microhttpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r--src/include/microhttpd.h50
1 files changed, 44 insertions, 6 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 01f31ca2..5efaca09 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -187,7 +187,24 @@ extern "C" {
187#define MHD_HTTP_VERSION_1_0 "HTTP/1.0" 187#define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
188#define MHD_HTTP_VERSION_1_1 "HTTP/1.1" 188#define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
189 189
190/**
191 * HTTP methods
192 */
193#define MHD_HTTP_METHOD_CONNECT "CONNECT"
194#define MHD_HTTP_METHOD_DELETE "DELETE"
195#define MHD_HTTP_METHOD_GET "GET"
196#define MHD_HTTP_METHOD_HEAD "HEAD"
197#define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
198#define MHD_HTTP_METHOD_POST "POST"
199#define MHD_HTTP_METHOD_PUT "PUT"
200#define MHD_HTTP_METHOD_TRACE "TRACE"
190 201
202/**
203 * HTTP POST encodings, see also
204 * http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
205 */
206#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
207#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
191 208
192/** 209/**
193 * Options for the MHD daemon. Note that if neither 210 * Options for the MHD daemon. Note that if neither
@@ -248,8 +265,16 @@ enum MHD_OPTION {
248 MHD_OPTION_END = 0, 265 MHD_OPTION_END = 0,
249 266
250 /** 267 /**
251 * FIXME: add options for buffer sizes here... 268 * Maximum memory size per connection (followed by an
269 * unsigned int).
270 */
271 MHD_OPTION_CONNECTION_MEMORY_LIMIT = 1,
272
273 /**
274 * Maximum number of concurrenct connections to
275 * accept (followed by an unsigned int).
252 */ 276 */
277 MHD_OPTION_CONNECTION_LIMIT = 2,
253 278
254}; 279};
255 280
@@ -265,22 +290,28 @@ enum MHD_ValueKind {
265 MHD_RESPONSE_HEADER_KIND = 0, 290 MHD_RESPONSE_HEADER_KIND = 0,
266 291
267 /** 292 /**
268 * HTTP header 293 * HTTP header.
269 */ 294 */
270 MHD_HEADER_KIND = 1, 295 MHD_HEADER_KIND = 1,
271 296
272 /** 297 /**
273 * Cookies 298 * Cookies. Note that the original HTTP header containing
299 * the cookie(s) will still be available and intact.
274 */ 300 */
275 MHD_COOKIE_KIND = 2, 301 MHD_COOKIE_KIND = 2,
276 302
277 /** 303 /**
278 * POST data 304 * POST data. This is available only if a content encoding
305 * supported by MHD is used (currently only URL encoding),
306 * and only if the posted content fits within the available
307 * memory pool. Note that in that case, the upload data
308 * given to the MHD_AccessHandlerCallback will be
309 * empty (since it has already been processed).
279 */ 310 */
280 MHD_POSTDATA_KIND = 4, 311 MHD_POSTDATA_KIND = 4,
281 312
282 /** 313 /**
283 * GET (URI) arguments 314 * GET (URI) arguments.
284 */ 315 */
285 MHD_GET_ARGUMENT_KIND = 8, 316 MHD_GET_ARGUMENT_KIND = 8,
286 317
@@ -326,9 +357,16 @@ typedef int
326 * @param url the requested url 357 * @param url the requested url
327 * @param method the HTTP method used ("GET", "PUT", etc.) 358 * @param method the HTTP method used ("GET", "PUT", etc.)
328 * @param version the HTTP version string (i.e. "HTTP/1.1") 359 * @param version the HTTP version string (i.e. "HTTP/1.1")
360 * @param upload_data the data being uploaded (excluding HEADERS,
361 * for a POST that fits into memory and that is encoded
362 * with a supported encoding, the POST data will NOT be
363 * given in upload_data and is instead available as
364 * part of MHD_get_connection_values; very large POST
365 * data *will* be made available incrementally in
366 * upload_data)
329 * @param upload_data_size set initially to the size of the 367 * @param upload_data_size set initially to the size of the
330 * upload_data provided; the method must update this 368 * upload_data provided; the method must update this
331 * value to the number of bytes NOT processed 369 * value to the number of bytes NOT processed;
332 * @return MHS_YES if the connection was handled successfully, 370 * @return MHS_YES if the connection was handled successfully,
333 * MHS_NO if the socket must be closed due to a serios 371 * MHS_NO if the socket must be closed due to a serios
334 * error while handling the request 372 * error while handling the request