|
Packit |
875988 |
/*
|
|
Packit |
875988 |
This file is part of libmicrohttpd
|
|
Packit |
875988 |
Copyright (C) 2006-2017 Christian Grothoff (and other contributing authors)
|
|
Packit |
875988 |
|
|
Packit |
875988 |
This library is free software; you can redistribute it and/or
|
|
Packit |
875988 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
875988 |
License as published by the Free Software Foundation; either
|
|
Packit |
875988 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
875988 |
|
|
Packit |
875988 |
This library is distributed in the hope that it will be useful,
|
|
Packit |
875988 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
875988 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
875988 |
Lesser General Public License for more details.
|
|
Packit |
875988 |
|
|
Packit |
875988 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
875988 |
License along with this library; if not, write to the Free Software
|
|
Packit |
875988 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @file microhttpd.h
|
|
Packit |
875988 |
* @brief public interface to libmicrohttpd
|
|
Packit |
875988 |
* @author Christian Grothoff
|
|
Packit |
875988 |
* @author Karlson2k (Evgeny Grin)
|
|
Packit |
875988 |
* @author Chris GauthierDickey
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* All symbols defined in this header start with MHD. MHD is a small
|
|
Packit |
875988 |
* HTTP daemon library. As such, it does not have any API for logging
|
|
Packit |
875988 |
* errors (you can only enable or disable logging to stderr). Also,
|
|
Packit |
875988 |
* it may not support all of the HTTP features directly, where
|
|
Packit |
875988 |
* applicable, portions of HTTP may have to be handled by clients of
|
|
Packit |
875988 |
* the library.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* The library is supposed to handle everything that it must handle
|
|
Packit |
875988 |
* (because the API would not allow clients to do this), such as basic
|
|
Packit |
875988 |
* connection management; however, detailed interpretations of headers
|
|
Packit |
875988 |
* -- such as range requests -- and HTTP methods are left to clients.
|
|
Packit |
875988 |
* The library does understand HEAD and will only send the headers of
|
|
Packit |
875988 |
* the response and not the body, even if the client supplied a body.
|
|
Packit |
875988 |
* The library also understands headers that control connection
|
|
Packit |
875988 |
* management (specifically, "Connection: close" and "Expect: 100
|
|
Packit |
875988 |
* continue" are understood and handled automatically).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* MHD understands POST data and is able to decode certain formats
|
|
Packit |
875988 |
* (at the moment only "application/x-www-form-urlencoded" and
|
|
Packit |
875988 |
* "mulitpart/formdata"). Unsupported encodings and large POST
|
|
Packit |
875988 |
* submissions may require the application to manually process
|
|
Packit |
875988 |
* the stream, which is provided to the main application (and thus can be
|
|
Packit |
875988 |
* processed, just not conveniently by MHD).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* The header file defines various constants used by the HTTP protocol.
|
|
Packit |
875988 |
* This does not mean that MHD actually interprets all of these
|
|
Packit |
875988 |
* values. The provided constants are exported as a convenience
|
|
Packit |
875988 |
* for users of the library. MHD does not verify that transmitted
|
|
Packit |
875988 |
* HTTP headers are part of the standard specification; users of the
|
|
Packit |
875988 |
* library are free to define their own extensions of the HTTP
|
|
Packit |
875988 |
* standard and use those with MHD.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* All functions are guaranteed to be completely reentrant and
|
|
Packit |
875988 |
* thread-safe (with the exception of #MHD_set_connection_value,
|
|
Packit |
875988 |
* which must only be used in a particular context).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @defgroup event event-loop control
|
|
Packit |
875988 |
* MHD API to start and stop the HTTP server and manage the event loop.
|
|
Packit |
875988 |
* @defgroup response generation of responses
|
|
Packit |
875988 |
* MHD API used to generate responses.
|
|
Packit |
875988 |
* @defgroup request handling of requests
|
|
Packit |
875988 |
* MHD API used to access information about requests.
|
|
Packit |
875988 |
* @defgroup authentication HTTP authentication
|
|
Packit |
875988 |
* MHD API related to basic and digest HTTP authentication.
|
|
Packit |
875988 |
* @defgroup logging logging
|
|
Packit |
875988 |
* MHD API to mange logging and error handling
|
|
Packit |
875988 |
* @defgroup specialized misc. specialized functions
|
|
Packit |
875988 |
* This group includes functions that do not fit into any particular
|
|
Packit |
875988 |
* category and that are rarely used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef MHD_MICROHTTPD_H
|
|
Packit |
875988 |
#define MHD_MICROHTTPD_H
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifdef __cplusplus
|
|
Packit |
875988 |
extern "C"
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
#if 0 /* keep Emacsens' auto-indent happy */
|
|
Packit |
875988 |
}
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* While we generally would like users to use a configure-driven
|
|
Packit |
875988 |
build process which detects which headers are present and
|
|
Packit |
875988 |
hence works on any platform, we use "standard" includes here
|
|
Packit |
875988 |
to build out-of-the-box for beginning users on common systems.
|
|
Packit |
875988 |
|
|
Packit |
875988 |
If generic headers don't work on your platform, include headers
|
|
Packit |
875988 |
which define 'va_list', 'size_t', 'ssize_t', 'intptr_t',
|
|
Packit |
875988 |
'uint16_t', 'uint32_t', 'uint64_t', 'off_t', 'struct sockaddr',
|
|
Packit |
875988 |
'socklen_t', 'fd_set' and "#define MHD_PLATFORM_H" before
|
|
Packit |
875988 |
including "microhttpd.h". Then the following "standard"
|
|
Packit |
875988 |
includes won't be used (which might be a good idea, especially
|
|
Packit |
875988 |
on platforms where they do not exist).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#ifndef MHD_PLATFORM_H
|
|
Packit |
875988 |
#include <stdarg.h>
|
|
Packit |
875988 |
#include <stdint.h>
|
|
Packit |
875988 |
#include <sys/types.h>
|
|
Packit |
875988 |
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
Packit |
875988 |
#include <ws2tcpip.h>
|
|
Packit |
875988 |
#if defined(_MSC_FULL_VER) && !defined (_SSIZE_T_DEFINED)
|
|
Packit |
875988 |
#define _SSIZE_T_DEFINED
|
|
Packit |
875988 |
typedef intptr_t ssize_t;
|
|
Packit |
875988 |
#endif /* !_SSIZE_T_DEFINED */
|
|
Packit |
875988 |
#else
|
|
Packit |
875988 |
#include <unistd.h>
|
|
Packit |
875988 |
#include <sys/time.h>
|
|
Packit |
875988 |
#include <sys/socket.h>
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if defined(__CYGWIN__) && !defined(_SYS_TYPES_FD_SET)
|
|
Packit |
875988 |
/* Do not define __USE_W32_SOCKETS under Cygwin! */
|
|
Packit |
875988 |
#error Cygwin with winsock fd_set is not supported
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Current version of the library.
|
|
Packit |
875988 |
* 0x01093001 = 1.9.30-1.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_VERSION 0x00095900
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* MHD-internal return code for "YES".
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_YES 1
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* MHD-internal return code for "NO".
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_NO 0
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* MHD digest auth internal code for an invalid nonce.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_INVALID_NONCE -1
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Constant used to indicate unknown size (use when
|
|
Packit |
875988 |
* creating a response).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#ifdef UINT64_MAX
|
|
Packit |
875988 |
#define MHD_SIZE_UNKNOWN UINT64_MAX
|
|
Packit |
875988 |
#else
|
|
Packit |
875988 |
#define MHD_SIZE_UNKNOWN ((uint64_t) -1LL)
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifdef SIZE_MAX
|
|
Packit |
875988 |
#define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX
|
|
Packit |
875988 |
#define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1)
|
|
Packit |
875988 |
#else
|
|
Packit |
875988 |
#define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL)
|
|
Packit |
875988 |
#define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1)
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_EXTERN
|
|
Packit |
875988 |
#if defined(_WIN32) && defined(MHD_W32LIB)
|
|
Packit |
875988 |
#define _MHD_EXTERN extern
|
|
Packit |
875988 |
#elif defined (_WIN32) && defined(MHD_W32DLL)
|
|
Packit |
875988 |
/* Define MHD_W32DLL when using MHD as W32 .DLL to speed up linker a little */
|
|
Packit |
875988 |
#define _MHD_EXTERN __declspec(dllimport)
|
|
Packit |
875988 |
#else
|
|
Packit |
875988 |
#define _MHD_EXTERN extern
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef MHD_SOCKET_DEFINED
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* MHD_socket is type for socket FDs
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#if !defined(_WIN32) || defined(_SYS_TYPES_FD_SET)
|
|
Packit |
875988 |
#define MHD_POSIX_SOCKETS 1
|
|
Packit |
875988 |
typedef int MHD_socket;
|
|
Packit |
875988 |
#define MHD_INVALID_SOCKET (-1)
|
|
Packit |
875988 |
#else /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
|
|
Packit |
875988 |
#define MHD_WINSOCK_SOCKETS 1
|
|
Packit |
875988 |
#include <winsock2.h>
|
|
Packit |
875988 |
typedef SOCKET MHD_socket;
|
|
Packit |
875988 |
#define MHD_INVALID_SOCKET (INVALID_SOCKET)
|
|
Packit |
875988 |
#endif /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */
|
|
Packit |
875988 |
#define MHD_SOCKET_DEFINED 1
|
|
Packit |
875988 |
#endif /* MHD_SOCKET_DEFINED */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Define MHD_NO_DEPRECATION before including "microhttpd.h" to disable deprecation messages
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#ifdef MHD_NO_DEPRECATION
|
|
Packit |
875988 |
#define _MHD_DEPR_MACRO(msg)
|
|
Packit |
875988 |
#define _MHD_NO_DEPR_IN_MACRO 1
|
|
Packit |
875988 |
#define _MHD_DEPR_IN_MACRO(msg)
|
|
Packit |
875988 |
#define _MHD_NO_DEPR_FUNC 1
|
|
Packit |
875988 |
#define _MHD_DEPR_FUNC(msg)
|
|
Packit |
875988 |
#endif /* MHD_NO_DEPRECATION */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_DEPR_MACRO
|
|
Packit |
875988 |
#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500
|
|
Packit |
875988 |
/* VS 2008 or later */
|
|
Packit |
875988 |
/* Stringify macros */
|
|
Packit |
875988 |
#define _MHD_INSTRMACRO(a) #a
|
|
Packit |
875988 |
#define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a)
|
|
Packit |
875988 |
/* deprecation message */
|
|
Packit |
875988 |
#define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg))
|
|
Packit |
875988 |
#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
|
|
Packit |
875988 |
#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__)
|
|
Packit |
875988 |
/* clang or GCC since 3.0 */
|
|
Packit |
875988 |
#define _MHD_GCC_PRAG(x) _Pragma (#x)
|
|
Packit |
875988 |
#if (defined(__clang__) && (__clang_major__+0 >= 5 || \
|
|
Packit |
875988 |
(!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))))) || \
|
|
Packit |
875988 |
__GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8)
|
|
Packit |
875988 |
/* clang >= 3.3 (or XCode's clang >= 5.0) or
|
|
Packit |
875988 |
GCC >= 4.8 */
|
|
Packit |
875988 |
#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg)
|
|
Packit |
875988 |
#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
|
|
Packit |
875988 |
#else /* older clang or GCC */
|
|
Packit |
875988 |
/* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */
|
|
Packit |
875988 |
#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg)
|
|
Packit |
875988 |
#if (defined(__clang__) && (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: clang >= 2.9, earlier versions not tested */
|
|
Packit |
875988 |
/* clang handles inline pragmas better than GCC */
|
|
Packit |
875988 |
#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg)
|
|
Packit |
875988 |
#endif /* clang >= 2.9 */
|
|
Packit |
875988 |
#endif /* older clang or GCC */
|
|
Packit |
875988 |
/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
|
|
Packit |
875988 |
#endif /* clang || GCC >= 3.0 */
|
|
Packit |
875988 |
#endif /* !_MHD_DEPR_MACRO */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_DEPR_MACRO
|
|
Packit |
875988 |
#define _MHD_DEPR_MACRO(msg)
|
|
Packit |
875988 |
#endif /* !_MHD_DEPR_MACRO */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_DEPR_IN_MACRO
|
|
Packit |
875988 |
#define _MHD_NO_DEPR_IN_MACRO 1
|
|
Packit |
875988 |
#define _MHD_DEPR_IN_MACRO(msg)
|
|
Packit |
875988 |
#endif /* !_MHD_DEPR_IN_MACRO */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_DEPR_FUNC
|
|
Packit |
875988 |
#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1400
|
|
Packit |
875988 |
/* VS 2005 or later */
|
|
Packit |
875988 |
#define _MHD_DEPR_FUNC(msg) __declspec(deprecated(msg))
|
|
Packit |
875988 |
#elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310
|
|
Packit |
875988 |
/* VS .NET 2003 deprecation do not support custom messages */
|
|
Packit |
875988 |
#define _MHD_DEPR_FUNC(msg) __declspec(deprecated)
|
|
Packit |
875988 |
#elif (__GNUC__+0 >= 5) || (defined (__clang__) && \
|
|
Packit |
875988 |
(__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9))) /* FIXME: earlier versions not tested */
|
|
Packit |
875988 |
/* GCC >= 5.0 or clang >= 2.9 */
|
|
Packit |
875988 |
#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg)))
|
|
Packit |
875988 |
#elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1)
|
|
Packit |
875988 |
/* 3.1 <= GCC < 5.0 or clang < 2.9 */
|
|
Packit |
875988 |
/* old GCC-style deprecation do not support custom messages */
|
|
Packit |
875988 |
#define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__))
|
|
Packit |
875988 |
/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */
|
|
Packit |
875988 |
#endif /* clang < 2.9 || GCC >= 3.1 */
|
|
Packit |
875988 |
#endif /* !_MHD_DEPR_FUNC */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_DEPR_FUNC
|
|
Packit |
875988 |
#define _MHD_NO_DEPR_FUNC 1
|
|
Packit |
875988 |
#define _MHD_DEPR_FUNC(msg)
|
|
Packit |
875988 |
#endif /* !_MHD_DEPR_FUNC */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Not all architectures and `printf()`'s support the `long long` type.
|
|
Packit |
875988 |
* This gives the ability to replace `long long` with just a `long`,
|
|
Packit |
875988 |
* standard `int` or a `short`.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#ifndef MHD_LONG_LONG
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @deprecated use #MHD_UNSIGNED_LONG_LONG instead!
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_LONG_LONG long long
|
|
Packit |
875988 |
#define MHD_UNSIGNED_LONG_LONG unsigned long long
|
|
Packit |
875988 |
#else /* MHD_LONG_LONG */
|
|
Packit |
875988 |
_MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Format string for printing a variable of type #MHD_LONG_LONG.
|
|
Packit |
875988 |
* You should only redefine this if you also define #MHD_LONG_LONG.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#ifndef MHD_LONG_LONG_PRINTF
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @deprecated use #MHD_UNSIGNED_LONG_LONG_PRINTF instead!
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_LONG_LONG_PRINTF "ll"
|
|
Packit |
875988 |
#define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu"
|
|
Packit |
875988 |
#else /* MHD_LONG_LONG_PRINTF */
|
|
Packit |
875988 |
_MHD_DEPR_MACRO("Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF")
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @defgroup httpcode HTTP response codes.
|
|
Packit |
875988 |
* These are the status codes defined for HTTP responses.
|
|
Packit |
875988 |
* @{
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
/* See http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_CONTINUE 100
|
|
Packit |
875988 |
#define MHD_HTTP_SWITCHING_PROTOCOLS 101
|
|
Packit |
875988 |
#define MHD_HTTP_PROCESSING 102
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_OK 200
|
|
Packit |
875988 |
#define MHD_HTTP_CREATED 201
|
|
Packit |
875988 |
#define MHD_HTTP_ACCEPTED 202
|
|
Packit |
875988 |
#define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203
|
|
Packit |
875988 |
#define MHD_HTTP_NO_CONTENT 204
|
|
Packit |
875988 |
#define MHD_HTTP_RESET_CONTENT 205
|
|
Packit |
875988 |
#define MHD_HTTP_PARTIAL_CONTENT 206
|
|
Packit |
875988 |
#define MHD_HTTP_MULTI_STATUS 207
|
|
Packit |
875988 |
#define MHD_HTTP_ALREADY_REPORTED 208
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_IM_USED 226
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_MULTIPLE_CHOICES 300
|
|
Packit |
875988 |
#define MHD_HTTP_MOVED_PERMANENTLY 301
|
|
Packit |
875988 |
#define MHD_HTTP_FOUND 302
|
|
Packit |
875988 |
#define MHD_HTTP_SEE_OTHER 303
|
|
Packit |
875988 |
#define MHD_HTTP_NOT_MODIFIED 304
|
|
Packit |
875988 |
#define MHD_HTTP_USE_PROXY 305
|
|
Packit |
875988 |
#define MHD_HTTP_SWITCH_PROXY 306
|
|
Packit |
875988 |
#define MHD_HTTP_TEMPORARY_REDIRECT 307
|
|
Packit |
875988 |
#define MHD_HTTP_PERMANENT_REDIRECT 308
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_BAD_REQUEST 400
|
|
Packit |
875988 |
#define MHD_HTTP_UNAUTHORIZED 401
|
|
Packit |
875988 |
#define MHD_HTTP_PAYMENT_REQUIRED 402
|
|
Packit |
875988 |
#define MHD_HTTP_FORBIDDEN 403
|
|
Packit |
875988 |
#define MHD_HTTP_NOT_FOUND 404
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_NOT_ALLOWED 405
|
|
Packit |
875988 |
#define MHD_HTTP_NOT_ACCEPTABLE 406
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") 406
|
|
Packit |
875988 |
#define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407
|
|
Packit |
875988 |
#define MHD_HTTP_REQUEST_TIMEOUT 408
|
|
Packit |
875988 |
#define MHD_HTTP_CONFLICT 409
|
|
Packit |
875988 |
#define MHD_HTTP_GONE 410
|
|
Packit |
875988 |
#define MHD_HTTP_LENGTH_REQUIRED 411
|
|
Packit |
875988 |
#define MHD_HTTP_PRECONDITION_FAILED 412
|
|
Packit |
875988 |
#define MHD_HTTP_PAYLOAD_TOO_LARGE 413
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") 413
|
|
Packit |
875988 |
#define MHD_HTTP_URI_TOO_LONG 414
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
#define MHD_HTTP_REQUEST_URI_TOO_LONG \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") 414
|
|
Packit |
875988 |
#define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415
|
|
Packit |
875988 |
#define MHD_HTTP_RANGE_NOT_SATISFIABLE 416
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") 416
|
|
Packit |
875988 |
#define MHD_HTTP_EXPECTATION_FAILED 417
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_MISDIRECTED_REQUEST 421
|
|
Packit |
875988 |
#define MHD_HTTP_UNPROCESSABLE_ENTITY 422
|
|
Packit |
875988 |
#define MHD_HTTP_LOCKED 423
|
|
Packit |
875988 |
#define MHD_HTTP_FAILED_DEPENDENCY 424
|
|
Packit |
875988 |
#define MHD_HTTP_UNORDERED_COLLECTION 425
|
|
Packit |
875988 |
#define MHD_HTTP_UPGRADE_REQUIRED 426
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_PRECONDITION_REQUIRED 428
|
|
Packit |
875988 |
#define MHD_HTTP_TOO_MANY_REQUESTS 429
|
|
Packit |
875988 |
#define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_NO_RESPONSE 444
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_RETRY_WITH 449
|
|
Packit |
875988 |
#define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450
|
|
Packit |
875988 |
#define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#define MHD_HTTP_INTERNAL_SERVER_ERROR 500
|
|
Packit |
875988 |
#define MHD_HTTP_NOT_IMPLEMENTED 501
|
|
Packit |
875988 |
#define MHD_HTTP_BAD_GATEWAY 502
|
|
Packit |
875988 |
#define MHD_HTTP_SERVICE_UNAVAILABLE 503
|
|
Packit |
875988 |
#define MHD_HTTP_GATEWAY_TIMEOUT 504
|
|
Packit |
875988 |
#define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505
|
|
Packit |
875988 |
#define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506
|
|
Packit |
875988 |
#define MHD_HTTP_INSUFFICIENT_STORAGE 507
|
|
Packit |
875988 |
#define MHD_HTTP_LOOP_DETECTED 508
|
|
Packit |
875988 |
#define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
|
|
Packit |
875988 |
#define MHD_HTTP_NOT_EXTENDED 510
|
|
Packit |
875988 |
#define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @} */ /* end of group httpcode */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Returns the string reason phrase for a response code.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* If we don't have a string for a status code, we give the first
|
|
Packit |
875988 |
* message in that status code class.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN const char *
|
|
Packit |
875988 |
MHD_get_reason_phrase_for (unsigned int code);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Flag to be or-ed with MHD_HTTP status code for
|
|
Packit |
875988 |
* SHOUTcast. This will cause the response to begin
|
|
Packit |
875988 |
* with the SHOUTcast "ICY" line instad of "HTTP".
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_ICY_FLAG ((uint32_t)(((uint32_t)1) << 31))
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @defgroup headers HTTP headers
|
|
Packit |
875988 |
* These are the standard headers found in HTTP requests and responses.
|
|
Packit |
875988 |
* See: http://www.iana.org/assignments/message-headers/message-headers.xml
|
|
Packit |
875988 |
* Registry Version 2017-01-27
|
|
Packit |
875988 |
* @{
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* Main HTTP headers. */
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.3.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT "Accept"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.3.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.3.4; RFC7694, Section 3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.3.5 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"
|
|
Packit |
875988 |
/* Standard. RFC7233, Section 2.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"
|
|
Packit |
875988 |
/* Standard. RFC7234, Section 5.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_AGE "Age"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 7.4.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ALLOW "Allow"
|
|
Packit |
875988 |
/* Standard. RFC7235, Section 4.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_AUTHORIZATION "Authorization"
|
|
Packit |
875988 |
/* Standard. RFC7234, Section 5.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control"
|
|
Packit |
875988 |
/* Reserved. RFC7230, Section 8.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CLOSE "Close"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 6.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONNECTION "Connection"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 3.1.2.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 3.1.3.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 3.3.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 3.1.4.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location"
|
|
Packit |
875988 |
/* Standard. RFC7233, Section 4.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 3.1.1.5 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 7.1.1.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DATE "Date"
|
|
Packit |
875988 |
/* Standard. RFC7232, Section 2.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ETAG "ETag"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.1.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_EXPECT "Expect"
|
|
Packit |
875988 |
/* Standard. RFC7234, Section 5.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_EXPIRES "Expires"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.5.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_FROM "From"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 5.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_HOST "Host"
|
|
Packit |
875988 |
/* Standard. RFC7232, Section 3.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF_MATCH "If-Match"
|
|
Packit |
875988 |
/* Standard. RFC7232, Section 3.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
|
|
Packit |
875988 |
/* Standard. RFC7232, Section 3.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match"
|
|
Packit |
875988 |
/* Standard. RFC7233, Section 3.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF_RANGE "If-Range"
|
|
Packit |
875988 |
/* Standard. RFC7232, Section 3.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
|
|
Packit |
875988 |
/* Standard. RFC7232, Section 2.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 7.1.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_LOCATION "Location"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.1.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards"
|
|
Packit |
875988 |
/* Standard. RFC7231, Appendix A.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version"
|
|
Packit |
875988 |
/* Standard. RFC7234, Section 5.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PRAGMA "Pragma"
|
|
Packit |
875988 |
/* Standard. RFC7235, Section 4.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate"
|
|
Packit |
875988 |
/* Standard. RFC7235, Section 4.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
|
|
Packit |
875988 |
/* Standard. RFC7233, Section 3.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_RANGE "Range"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.5.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_REFERER "Referer"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 7.1.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 7.4.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SERVER "Server"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 4.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TE "TE"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 4.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TRAILER "Trailer"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 3.3.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 6.7 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_UPGRADE "Upgrade"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 5.5.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_USER_AGENT "User-Agent"
|
|
Packit |
875988 |
/* Standard. RFC7231, Section 7.1.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_VARY "Vary"
|
|
Packit |
875988 |
/* Standard. RFC7230, Section 5.7.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_VIA "Via"
|
|
Packit |
875988 |
/* Standard. RFC7235, Section 4.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate"
|
|
Packit |
875988 |
/* Standard. RFC7234, Section 5.5 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_WARNING "Warning"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* Additional HTTP headers. */
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_A_IM "A-IM"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions"
|
|
Packit |
875988 |
/* Informational. RFC7089 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features"
|
|
Packit |
875988 |
/* No category. RFC5789 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch"
|
|
Packit |
875988 |
/* Standard. RFC7639, Section 2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ALPN "ALPN"
|
|
Packit |
875988 |
/* Standard. RFC7838 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc"
|
|
Packit |
875988 |
/* Standard. RFC7838 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ALT_USED "Alt-Used"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ALTERNATES "Alternates"
|
|
Packit |
875988 |
/* No category. RFC4437 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref"
|
|
Packit |
875988 |
/* Experimental. RFC8053, Section 4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control"
|
|
Packit |
875988 |
/* Standard. RFC7615, Section 3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_C_EXT "C-Ext"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_C_MAN "C-Man"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_C_OPT "C-Opt"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_C_PEP "C-PEP"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info"
|
|
Packit |
875988 |
/* Standard. RFC7809, Section 7.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
|
|
Packit |
875988 |
/* Obsoleted. RFC2068; RFC2616 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
|
|
Packit |
875988 |
/* Standard. RFC6266 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_ID "Content-ID"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version"
|
|
Packit |
875988 |
/* Standard. RFC6265 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_COOKIE "Cookie"
|
|
Packit |
875988 |
/* Obsoleted. RFC2965; RFC6265 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_COOKIE2 "Cookie2"
|
|
Packit |
875988 |
/* Standard. RFC5323 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DASL "DASL"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DAV "DAV"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DEPTH "Depth"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DESTINATION "Destination"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_DIGEST "Digest"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_EXT "Ext"
|
|
Packit |
875988 |
/* Standard. RFC7239 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_FORWARDED "Forwarded"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_GETPROFILE "GetProfile"
|
|
Packit |
875988 |
/* Experimental. RFC7486, Section 6.1.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_HOBAREG "Hobareg"
|
|
Packit |
875988 |
/* Standard. RFC7540, Section 3.2.1 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IM "IM"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF "If"
|
|
Packit |
875988 |
/* Standard. RFC6638 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_LABEL "Label"
|
|
Packit |
875988 |
/* No category. RFC5988 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_LINK "Link"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_MAN "Man"
|
|
Packit |
875988 |
/* Informational. RFC7089 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_METER "Meter"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_NEGOTIATE "Negotiate"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_OPT "Opt"
|
|
Packit |
875988 |
/* Experimental. RFC8053, Section 3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate"
|
|
Packit |
875988 |
/* Standard. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
|
|
Packit |
875988 |
/* Standard. RFC6454 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ORIGIN "Origin"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_P3P "P3P"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PEP "PEP"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PEP_INFO "Pep-Info"
|
|
Packit |
875988 |
/* Standard. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_POSITION "Position"
|
|
Packit |
875988 |
/* Standard. RFC7240 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PREFER "Prefer"
|
|
Packit |
875988 |
/* Standard. RFC7240 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROTOCOL "Protocol"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request"
|
|
Packit |
875988 |
/* Standard. RFC7615, Section 4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PUBLIC "Public"
|
|
Packit |
875988 |
/* Standard. RFC7469 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins"
|
|
Packit |
875988 |
/* Standard. RFC7469 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY "Public-Key-Pins-Report-Only"
|
|
Packit |
875988 |
/* No category. RFC4437 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SAFE "Safe"
|
|
Packit |
875988 |
/* Standard. RFC6638 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply"
|
|
Packit |
875988 |
/* Standard. RFC6638 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag"
|
|
Packit |
875988 |
/* Standard. RFC6455 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept"
|
|
Packit |
875988 |
/* Standard. RFC6455 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions"
|
|
Packit |
875988 |
/* Standard. RFC6455 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key"
|
|
Packit |
875988 |
/* Standard. RFC6455 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol"
|
|
Packit |
875988 |
/* Standard. RFC6455 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme"
|
|
Packit |
875988 |
/* Standard. RFC6265 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie"
|
|
Packit |
875988 |
/* Obsoleted. RFC2965; RFC6265 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SETPROFILE "SetProfile"
|
|
Packit |
875988 |
/* Standard. RFC5023 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SLUG "SLUG"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SOAPACTION "SoapAction"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_STATUS_URI "Status-URI"
|
|
Packit |
875988 |
/* Standard. RFC6797 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TCN "TCN"
|
|
Packit |
875988 |
/* Standard. RFC4918 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TIMEOUT "Timeout"
|
|
Packit |
875988 |
/* Standard. RFC8030, Section 5.4 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TOPIC "Topic"
|
|
Packit |
875988 |
/* Standard. RFC8030, Section 5.2 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_TTL "TTL"
|
|
Packit |
875988 |
/* Standard. RFC8030, Section 5.3 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_URGENCY "Urgency"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_URI "URI"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary"
|
|
Packit |
875988 |
/* No category. RFC4229 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest"
|
|
Packit |
875988 |
/* Informational. RFC7034 */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* Some provisional headers. */
|
|
Packit |
875988 |
#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin"
|
|
Packit |
875988 |
/** @} */ /* end of group headers */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @defgroup versions HTTP versions
|
|
Packit |
875988 |
* These strings should be used to match against the first line of the
|
|
Packit |
875988 |
* HTTP header.
|
|
Packit |
875988 |
* @{
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_HTTP_VERSION_1_0 "HTTP/1.0"
|
|
Packit |
875988 |
#define MHD_HTTP_VERSION_1_1 "HTTP/1.1"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @} */ /* end of group versions */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @defgroup methods HTTP methods
|
|
Packit |
875988 |
* HTTP methods (as strings).
|
|
Packit |
875988 |
* See: http://www.iana.org/assignments/http-methods/http-methods.xml
|
|
Packit |
875988 |
* Registry Version 2015-05-19
|
|
Packit |
875988 |
* @{
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
/* Main HTTP methods. */
|
|
Packit |
875988 |
/* Not safe. Not idempotent. RFC7231, Section 4.3.6. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_CONNECT "CONNECT"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC7231, Section 4.3.5. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_DELETE "DELETE"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC7231, Section 4.3.1. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_GET "GET"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC7231, Section 4.3.2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_HEAD "HEAD"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC7231, Section 4.3.7. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
|
|
Packit |
875988 |
/* Not safe. Not idempotent. RFC7231, Section 4.3.3. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_POST "POST"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC7231, Section 4.3.4. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_PUT "PUT"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC7231, Section 4.3.8. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_TRACE "TRACE"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* Additional HTTP methods. */
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3744, Section 8.1. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_ACL "ACL"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 12.6. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC5842, Section 4. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_BIND "BIND"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 4.4, Section 9.4. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 4.3, Section 8.8. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4918, Section 9.8. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_COPY "COPY"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 8.2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_LABEL "LABEL"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC2068, Section 19.6.1.2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_LINK "LINK"
|
|
Packit |
875988 |
/* Not safe. Not idempotent. RFC4918, Section 9.10. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_LOCK "LOCK"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 11.2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MERGE "MERGE"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 13.5. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4791, Section 5.3.1. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4918, Section 9.3. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MKCOL "MKCOL"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4437, Section 6. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 6.3. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4918, Section 9.9. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_MOVE "MOVE"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3648, Section 7. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
|
|
Packit |
875988 |
/* Not safe. Not idempotent. RFC5789, Section 2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_PATCH "PATCH"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC7540, Section 3.5. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_PRI "PRI"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC4918, Section 9.1. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4918, Section 9.2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC5842, Section 6. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_REBIND "REBIND"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC3253, Section 3.6. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_REPORT "REPORT"
|
|
Packit |
875988 |
/* Safe. Idempotent. RFC5323, Section 2. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_SEARCH "SEARCH"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC5842, Section 5. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_UNBIND "UNBIND"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 4.5. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC2068, Section 19.6.1.3. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_UNLINK "UNLINK"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4918, Section 9.11. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 7.1. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_UPDATE "UPDATE"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC4437, Section 7. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF"
|
|
Packit |
875988 |
/* Not safe. Idempotent. RFC3253, Section 3.5. */
|
|
Packit |
875988 |
#define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @} */ /* end of group methods */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @defgroup postenc HTTP POST encodings
|
|
Packit |
875988 |
* See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
|
|
Packit |
875988 |
* @{
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED "application/x-www-form-urlencoded"
|
|
Packit |
875988 |
#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @} */ /* end of group postenc */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @brief Handle for the daemon (listening on a socket for HTTP traffic).
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_Daemon;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @brief Handle for a connection / HTTP request.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* With HTTP/1.1, multiple requests can be run over the same
|
|
Packit |
875988 |
* connection. However, MHD will only show one request per TCP
|
|
Packit |
875988 |
* connection to the client at any given time.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_Connection;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @brief Handle for a response.
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_Response;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @brief Handle for POST processing.
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_PostProcessor;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @brief Flags for the `struct MHD_Daemon`.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Note that MHD will run automatically in background thread(s) only
|
|
Packit |
875988 |
* if #MHD_USE_INTERNAL_POLLING_THREAD is used. Otherwise caller (application)
|
|
Packit |
875988 |
* must use #MHD_run() or #MHD_run_from_select() to have MHD processed
|
|
Packit |
875988 |
* network connections and data.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Starting the daemon may also fail if a particular option is not
|
|
Packit |
875988 |
* implemented or not supported on the target platform (i.e. no
|
|
Packit |
875988 |
* support for TLS, epoll or IPv6).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_FLAG
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* No options selected.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_NO_FLAG = 0,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Print errors messages to custom error logger or to `stderr` if
|
|
Packit |
875988 |
* custom error logger is not set.
|
|
Packit |
875988 |
* @sa ::MHD_OPTION_EXTERNAL_LOGGER
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_ERROR_LOG = 1,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run in debug mode. If this flag is used, the library should
|
|
Packit |
875988 |
* print error messages and warnings to `stderr`.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_DEBUG = 1,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run in HTTPS mode. The modern protocol is called TLS.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_TLS = 2,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_SSL = 2,
|
|
Packit |
875988 |
#if 0
|
|
Packit |
875988 |
/* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */
|
|
Packit |
875988 |
#define MHD_USE_SSL \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \
|
|
Packit |
875988 |
MHD_USE_TLS
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run using one thread per connection.
|
|
Packit |
875988 |
* Must be used only with #MHD_USE_INTERNAL_POLLING_THREAD.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_THREAD_PER_CONNECTION = 4,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run using an internal thread (or thread pool) for sockets sending
|
|
Packit |
875988 |
* and receiving and data processing. Without this flag MHD will not
|
|
Packit |
875988 |
* run automatically in background thread(s).
|
|
Packit |
875988 |
* If this flag is set, #MHD_run() and #MHD_run_from_select() couldn't
|
|
Packit |
875988 |
* be used.
|
|
Packit |
875988 |
* This flag is set explicitly by #MHD_USE_POLL_INTERNAL_THREAD and
|
|
Packit |
875988 |
* by #MHD_USE_EPOLL_INTERNAL_THREAD.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_INTERNAL_POLLING_THREAD = 8,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_SELECT_INTERNALLY = 8,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_SELECT_INTERNALLY \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \
|
|
Packit |
875988 |
MHD_USE_INTERNAL_POLLING_THREAD
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run using the IPv6 protocol (otherwise, MHD will just support
|
|
Packit |
875988 |
* IPv4). If you want MHD to support IPv4 and IPv6 using a single
|
|
Packit |
875988 |
* socket, pass #MHD_USE_DUAL_STACK, otherwise, if you only pass
|
|
Packit |
875988 |
* this option, MHD will try to bind to IPv6-only (resulting in
|
|
Packit |
875988 |
* no IPv4 support).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_IPv6 = 16,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Be pedantic about the protocol (as opposed to as tolerant as
|
|
Packit |
875988 |
* possible). Specifically, at the moment, this flag causes MHD to
|
|
Packit |
875988 |
* reject HTTP 1.1 connections without a "Host" header. This is
|
|
Packit |
875988 |
* required by the standard, but of course in violation of the "be
|
|
Packit |
875988 |
* as liberal as possible in what you accept" norm. It is
|
|
Packit |
875988 |
* recommended to turn this ON if you are testing clients against
|
|
Packit |
875988 |
* MHD, and OFF in production.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_PEDANTIC_CHECKS = 32,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_PEDANTIC_CHECKS \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \
|
|
Packit |
875988 |
32
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Use `poll()` instead of `select()`. This allows sockets with `fd >=
|
|
Packit |
875988 |
* FD_SETSIZE`. This option is not compatible with using an
|
|
Packit |
875988 |
* 'external' polling mode (as there is no API to get the file
|
|
Packit |
875988 |
* descriptors for the external poll() from MHD) and must also not
|
|
Packit |
875988 |
* be used in combination with #MHD_USE_EPOLL.
|
|
Packit |
875988 |
* @sa ::MHD_FEATURE_POLL, #MHD_USE_POLL_INTERNAL_THREAD
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_POLL = 64,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run using an internal thread (or thread pool) doing `poll()`.
|
|
Packit |
875988 |
* @sa ::MHD_FEATURE_POLL, #MHD_USE_POLL, #MHD_USE_INTERNAL_POLLING_THREAD
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_POLL_INTERNAL_THREAD = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_POLL_INTERNALLY = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_POLL_INTERNALLY \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \
|
|
Packit |
875988 |
MHD_USE_POLL_INTERNAL_THREAD
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Suppress (automatically) adding the 'Date:' header to HTTP responses.
|
|
Packit |
875988 |
* This option should ONLY be used on systems that do not have a clock
|
|
Packit |
875988 |
* and that DO provide other mechanisms for cache control. See also
|
|
Packit |
875988 |
* RFC 2616, section 14.18 (exception 3).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_SUPPRESS_DATE_NO_CLOCK = 128,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_SUPPRESS_DATE_NO_CLOCK = 128,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_SUPPRESS_DATE_NO_CLOCK \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \
|
|
Packit |
875988 |
MHD_USE_SUPPRESS_DATE_NO_CLOCK
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run without a listen socket. This option only makes sense if
|
|
Packit |
875988 |
* #MHD_add_connection is to be used exclusively to connect HTTP
|
|
Packit |
875988 |
* clients to the HTTP server. This option is incompatible with
|
|
Packit |
875988 |
* using a thread pool; if it is used, #MHD_OPTION_THREAD_POOL_SIZE
|
|
Packit |
875988 |
* is ignored.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_NO_LISTEN_SOCKET = 256,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Use `epoll()` instead of `select()` or `poll()` for the event loop.
|
|
Packit |
875988 |
* This option is only available on some systems; using the option on
|
|
Packit |
875988 |
* systems without epoll will cause #MHD_start_daemon to fail. Using
|
|
Packit |
875988 |
* this option is not supported with #MHD_USE_THREAD_PER_CONNECTION.
|
|
Packit |
875988 |
* @sa ::MHD_FEATURE_EPOLL
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_EPOLL = 512,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_EPOLL_LINUX_ONLY = 512,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_EPOLL_LINUX_ONLY \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \
|
|
Packit |
875988 |
MHD_USE_EPOLL
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run using an internal thread (or thread pool) doing `epoll()`.
|
|
Packit |
875988 |
* This option is only available on certain platforms; using the option on
|
|
Packit |
875988 |
* platform without `epoll` support will cause #MHD_start_daemon to fail.
|
|
Packit |
875988 |
* @sa ::MHD_FEATURE_EPOLL, #MHD_USE_EPOLL, #MHD_USE_INTERNAL_POLLING_THREAD
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_EPOLL_INTERNAL_THREAD = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_EPOLL_INTERNALLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD,
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_EPOLL_INTERNALLY \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
|
|
Packit |
875988 |
MHD_USE_EPOLL_INTERNAL_THREAD
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
#define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \
|
|
Packit |
875988 |
MHD_USE_EPOLL_INTERNAL_THREAD
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Use inter-thread communication channel.
|
|
Packit |
875988 |
* #MHD_USE_ITC can be used with #MHD_USE_INTERNAL_POLLING_THREAD
|
|
Packit |
875988 |
* and is ignored with any "external" mode.
|
|
Packit |
875988 |
* It's required for use of #MHD_quiesce_daemon
|
|
Packit |
875988 |
* or #MHD_add_connection.
|
|
Packit |
875988 |
* This option is enforced by #MHD_ALLOW_SUSPEND_RESUME or
|
|
Packit |
875988 |
* #MHD_USE_NO_LISTEN_SOCKET.
|
|
Packit |
875988 |
* #MHD_USE_ITC is always used automatically on platforms
|
|
Packit |
875988 |
* where select()/poll()/other ignore shutdown of listen
|
|
Packit |
875988 |
* socket.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_ITC = 1024,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_PIPE_FOR_SHUTDOWN = 1024,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_PIPE_FOR_SHUTDOWN \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \
|
|
Packit |
875988 |
MHD_USE_ITC
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Use a single socket for IPv4 and IPv6.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_DUAL_STACK = MHD_USE_IPv6 | 2048,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Enable `turbo`. Disables certain calls to `shutdown()`,
|
|
Packit |
875988 |
* enables aggressive non-blocking optimistic reads and
|
|
Packit |
875988 |
* other potentially unsafe optimizations.
|
|
Packit |
875988 |
* Most effects only happen with #MHD_USE_EPOLL.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_TURBO = 4096,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_EPOLL_TURBO = 4096,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_EPOLL_TURBO \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
|
|
Packit |
875988 |
MHD_USE_TURBO
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Enable suspend/resume functions, which also implies setting up
|
|
Packit |
875988 |
* ITC to signal resume.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_ALLOW_SUSPEND_RESUME = 8192 | MHD_USE_ITC,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/** @deprecated */
|
|
Packit |
875988 |
MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_ITC,
|
|
Packit |
875988 |
#if 0 /* Will be marked for real deprecation later. */
|
|
Packit |
875988 |
#define MHD_USE_SUSPEND_RESUME \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \
|
|
Packit |
875988 |
MHD_ALLOW_SUSPEND_RESUME
|
|
Packit |
875988 |
#endif /* 0 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Enable TCP_FASTOPEN option. This option is only available on Linux with a
|
|
Packit |
875988 |
* kernel >= 3.6. On other systems, using this option cases #MHD_start_daemon
|
|
Packit |
875988 |
* to fail.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_TCP_FASTOPEN = 16384,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* You need to set this option if you want to use HTTP "Upgrade".
|
|
Packit |
875988 |
* "Upgrade" may require usage of additional internal resources,
|
|
Packit |
875988 |
* which we do not want to use unless necessary.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_ALLOW_UPGRADE = 32768,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Automatically use best available polling function.
|
|
Packit |
875988 |
* Choice of polling function is also depend on other daemon options.
|
|
Packit |
875988 |
* If #MHD_USE_INTERNAL_POLLING_THREAD is specified then epoll, poll() or
|
|
Packit |
875988 |
* select() will be used (listed in decreasing preference order, first
|
|
Packit |
875988 |
* function available on system will be used).
|
|
Packit |
875988 |
* If #MHD_USE_THREAD_PER_CONNECTION is specified then poll() or select()
|
|
Packit |
875988 |
* will be used.
|
|
Packit |
875988 |
* If those flags are not specified then epoll or select() will be
|
|
Packit |
875988 |
* used (as the only suitable for MHD_get_fdset())
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_AUTO = 65536,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run using an internal thread (or thread pool) with best available on
|
|
Packit |
875988 |
* system polling function.
|
|
Packit |
875988 |
* This is combination of #MHD_USE_AUTO and #MHD_USE_INTERNAL_POLLING_THREAD
|
|
Packit |
875988 |
* flags.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_USE_AUTO_INTERNAL_THREAD = MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Type of a callback function used for logging by MHD.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls closure
|
|
Packit |
875988 |
* @param fm format string (`printf()`-style)
|
|
Packit |
875988 |
* @param ap arguments to @a fm
|
|
Packit |
875988 |
* @ingroup logging
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef void
|
|
Packit |
875988 |
(*MHD_LogCallback)(void *cls,
|
|
Packit |
875988 |
const char *fm,
|
|
Packit |
875988 |
va_list ap);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @brief MHD options.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Passed in the varargs portion of #MHD_start_daemon.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_OPTION
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* No more options / last option. This is used
|
|
Packit |
875988 |
* to terminate the VARARGs list.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_END = 0,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Maximum memory size per connection (followed by a `size_t`).
|
|
Packit |
875988 |
* Default is 32 kb (#MHD_POOL_SIZE_DEFAULT).
|
|
Packit |
875988 |
* Values above 128k are unlikely to result in much benefit, as half
|
|
Packit |
875988 |
* of the memory will be typically used for IO, and TCP buffers are
|
|
Packit |
875988 |
* unlikely to support window sizes above 64k on most systems.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_CONNECTION_MEMORY_LIMIT = 1,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Maximum number of concurrent connections to
|
|
Packit |
875988 |
* accept (followed by an `unsigned int`).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_CONNECTION_LIMIT = 2,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* After how many seconds of inactivity should a
|
|
Packit |
875988 |
* connection automatically be timed out? (followed
|
|
Packit |
875988 |
* by an `unsigned int`; use zero for no timeout).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_CONNECTION_TIMEOUT = 3,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Register a function that should be called whenever a request has
|
|
Packit |
875988 |
* been completed (this can be used for application-specific clean
|
|
Packit |
875988 |
* up). Requests that have never been presented to the application
|
|
Packit |
875988 |
* (via #MHD_AccessHandlerCallback) will not result in
|
|
Packit |
875988 |
* notifications.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This option should be followed by TWO pointers. First a pointer
|
|
Packit |
875988 |
* to a function of type #MHD_RequestCompletedCallback and second a
|
|
Packit |
875988 |
* pointer to a closure to pass to the request completed callback.
|
|
Packit |
875988 |
* The second pointer maybe NULL.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_NOTIFY_COMPLETED = 4,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Limit on the number of (concurrent) connections made to the
|
|
Packit |
875988 |
* server from the same IP address. Can be used to prevent one
|
|
Packit |
875988 |
* IP from taking over all of the allowed connections. If the
|
|
Packit |
875988 |
* same IP tries to establish more than the specified number of
|
|
Packit |
875988 |
* connections, they will be immediately rejected. The option
|
|
Packit |
875988 |
* should be followed by an `unsigned int`. The default is
|
|
Packit |
875988 |
* zero, which means no limit on the number of connections
|
|
Packit |
875988 |
* from the same IP address.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_PER_IP_CONNECTION_LIMIT = 5,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Bind daemon to the supplied `struct sockaddr`. This option should
|
|
Packit |
875988 |
* be followed by a `struct sockaddr *`. If #MHD_USE_IPv6 is
|
|
Packit |
875988 |
* specified, the `struct sockaddr*` should point to a `struct
|
|
Packit |
875988 |
* sockaddr_in6`, otherwise to a `struct sockaddr_in`.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_SOCK_ADDR = 6,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Specify a function that should be called before parsing the URI from
|
|
Packit |
875988 |
* the client. The specified callback function can be used for processing
|
|
Packit |
875988 |
* the URI (including the options) before it is parsed. The URI after
|
|
Packit |
875988 |
* parsing will no longer contain the options, which maybe inconvenient for
|
|
Packit |
875988 |
* logging. This option should be followed by two arguments, the first
|
|
Packit |
875988 |
* one must be of the form
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* void * my_logger(void *cls, const char *uri, struct MHD_Connection *con)
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* where the return value will be passed as
|
|
Packit |
875988 |
* (`* con_cls`) in calls to the #MHD_AccessHandlerCallback
|
|
Packit |
875988 |
* when this request is processed later; returning a
|
|
Packit |
875988 |
* value of NULL has no special significance (however,
|
|
Packit |
875988 |
* note that if you return non-NULL, you can no longer
|
|
Packit |
875988 |
* rely on the first call to the access handler having
|
|
Packit |
875988 |
* `NULL == *con_cls` on entry;)
|
|
Packit |
875988 |
* "cls" will be set to the second argument following
|
|
Packit |
875988 |
* #MHD_OPTION_URI_LOG_CALLBACK. Finally, uri will
|
|
Packit |
875988 |
* be the 0-terminated URI of the request.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Note that during the time of this call, most of the connection's
|
|
Packit |
875988 |
* state is not initialized (as we have not yet parsed the headers).
|
|
Packit |
875988 |
* However, information about the connecting client (IP, socket)
|
|
Packit |
875988 |
* is available.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* The specified function is called only once per request, therefore some
|
|
Packit |
875988 |
* programmers may use it to instantiate their own request objects, freeing
|
|
Packit |
875988 |
* them in the notifier #MHD_OPTION_NOTIFY_COMPLETED.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_URI_LOG_CALLBACK = 7,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer for the private key (key.pem) to be used by the
|
|
Packit |
875988 |
* HTTPS daemon. This option should be followed by a
|
|
Packit |
875988 |
* `const char *` argument.
|
|
Packit |
875988 |
* This should be used in conjunction with #MHD_OPTION_HTTPS_MEM_CERT.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_MEM_KEY = 8,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer for the certificate (cert.pem) to be used by the
|
|
Packit |
875988 |
* HTTPS daemon. This option should be followed by a
|
|
Packit |
875988 |
* `const char *` argument.
|
|
Packit |
875988 |
* This should be used in conjunction with #MHD_OPTION_HTTPS_MEM_KEY.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_MEM_CERT = 9,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Daemon credentials type.
|
|
Packit |
875988 |
* Followed by an argument of type
|
|
Packit |
875988 |
* `gnutls_credentials_type_t`.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_CRED_TYPE = 10,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer to a `const char *` specifying the
|
|
Packit |
875988 |
* cipher algorithm (default: "NORMAL").
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_PRIORITIES = 11,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Pass a listen socket for MHD to use (systemd-style). If this
|
|
Packit |
875988 |
* option is used, MHD will not open its own listen socket(s). The
|
|
Packit |
875988 |
* argument passed must be of type `MHD_socket` and refer to an
|
|
Packit |
875988 |
* existing socket that has been bound to a port and is listening.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_LISTEN_SOCKET = 12,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Use the given function for logging error messages. This option
|
|
Packit |
875988 |
* must be followed by two arguments; the first must be a pointer to
|
|
Packit |
875988 |
* a function of type #MHD_LogCallback and the second a pointer
|
|
Packit |
875988 |
* `void *` which will be passed as the first argument to the log
|
|
Packit |
875988 |
* callback.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Note that MHD will not generate any log messages
|
|
Packit |
875988 |
* if it was compiled without the "--enable-messages"
|
|
Packit |
875988 |
* flag being set.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_EXTERNAL_LOGGER = 13,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Number (`unsigned int`) of threads in thread pool. Enable
|
|
Packit |
875988 |
* thread pooling by setting this value to to something
|
|
Packit |
875988 |
* greater than 1. Currently, thread model must be
|
|
Packit |
875988 |
* #MHD_USE_INTERNAL_POLLING_THREAD if thread pooling is enabled
|
|
Packit |
875988 |
* (#MHD_start_daemon returns NULL for an unsupported thread
|
|
Packit |
875988 |
* model).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_THREAD_POOL_SIZE = 14,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Additional options given in an array of `struct MHD_OptionItem`.
|
|
Packit |
875988 |
* The array must be terminated with an entry `{MHD_OPTION_END, 0, NULL}`.
|
|
Packit |
875988 |
* An example for code using #MHD_OPTION_ARRAY is:
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* struct MHD_OptionItem ops[] = {
|
|
Packit |
875988 |
* { MHD_OPTION_CONNECTION_LIMIT, 100, NULL },
|
|
Packit |
875988 |
* { MHD_OPTION_CONNECTION_TIMEOUT, 10, NULL },
|
|
Packit |
875988 |
* { MHD_OPTION_END, 0, NULL }
|
|
Packit |
875988 |
* };
|
|
Packit |
875988 |
* d = MHD_start_daemon (0, 8080, NULL, NULL, dh, NULL,
|
|
Packit |
875988 |
* MHD_OPTION_ARRAY, ops,
|
|
Packit |
875988 |
* MHD_OPTION_END);
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* For options that expect a single pointer argument, the
|
|
Packit |
875988 |
* second member of the `struct MHD_OptionItem` is ignored.
|
|
Packit |
875988 |
* For options that expect two pointer arguments, the first
|
|
Packit |
875988 |
* argument must be cast to `intptr_t`.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_ARRAY = 15,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Specify a function that should be called for unescaping escape
|
|
Packit |
875988 |
* sequences in URIs and URI arguments. Note that this function
|
|
Packit |
875988 |
* will NOT be used by the `struct MHD_PostProcessor`. If this
|
|
Packit |
875988 |
* option is not specified, the default method will be used which
|
|
Packit |
875988 |
* decodes escape sequences of the form "%HH". This option should
|
|
Packit |
875988 |
* be followed by two arguments, the first one must be of the form
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* size_t my_unescaper(void *cls,
|
|
Packit |
875988 |
* struct MHD_Connection *c,
|
|
Packit |
875988 |
* char *s)
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* where the return value must be "strlen(s)" and "s" should be
|
|
Packit |
875988 |
* updated. Note that the unescape function must not lengthen "s"
|
|
Packit |
875988 |
* (the result must be shorter than the input and still be
|
|
Packit |
875988 |
* 0-terminated). "cls" will be set to the second argument
|
|
Packit |
875988 |
* following #MHD_OPTION_UNESCAPE_CALLBACK.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_UNESCAPE_CALLBACK = 16,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer for the random values to be used by the Digest
|
|
Packit |
875988 |
* Auth module. This option should be followed by two arguments.
|
|
Packit |
875988 |
* First an integer of type `size_t` which specifies the size
|
|
Packit |
875988 |
* of the buffer pointed to by the second argument in bytes.
|
|
Packit |
875988 |
* Note that the application must ensure that the buffer of the
|
|
Packit |
875988 |
* second argument remains allocated and unmodified while the
|
|
Packit |
875988 |
* deamon is running.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_DIGEST_AUTH_RANDOM = 17,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Size of the internal array holding the map of the nonce and
|
|
Packit |
875988 |
* the nonce counter. This option should be followed by an `unsigend int`
|
|
Packit |
875988 |
* argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_NONCE_NC_SIZE = 18,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Desired size of the stack for threads created by MHD. Followed
|
|
Packit |
875988 |
* by an argument of type `size_t`. Use 0 for system default.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_THREAD_STACK_SIZE = 19,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer for the certificate (ca.pem) to be used by the
|
|
Packit |
875988 |
* HTTPS daemon for client authentification.
|
|
Packit |
875988 |
* This option should be followed by a `const char *` argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_MEM_TRUST = 20,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Increment to use for growing the read buffer (followed by a
|
|
Packit |
875988 |
* `size_t`). Must fit within #MHD_OPTION_CONNECTION_MEMORY_LIMIT.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_CONNECTION_MEMORY_INCREMENT = 21,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Use a callback to determine which X.509 certificate should be
|
|
Packit |
875988 |
* used for a given HTTPS connection. This option should be
|
|
Packit |
875988 |
* followed by a argument of type `gnutls_certificate_retrieve_function2 *`.
|
|
Packit |
875988 |
* This option provides an
|
|
Packit |
875988 |
* alternative to #MHD_OPTION_HTTPS_MEM_KEY,
|
|
Packit |
875988 |
* #MHD_OPTION_HTTPS_MEM_CERT. You must use this version if
|
|
Packit |
875988 |
* multiple domains are to be hosted at the same IP address using
|
|
Packit |
875988 |
* TLS's Server Name Indication (SNI) extension. In this case,
|
|
Packit |
875988 |
* the callback is expected to select the correct certificate
|
|
Packit |
875988 |
* based on the SNI information provided. The callback is expected
|
|
Packit |
875988 |
* to access the SNI data using `gnutls_server_name_get()`.
|
|
Packit |
875988 |
* Using this option requires GnuTLS 3.0 or higher.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_CERT_CALLBACK = 22,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* When using #MHD_USE_TCP_FASTOPEN, this option changes the default TCP
|
|
Packit |
875988 |
* fastopen queue length of 50. Note that having a larger queue size can
|
|
Packit |
875988 |
* cause resource exhaustion attack as the TCP stack has to now allocate
|
|
Packit |
875988 |
* resources for the SYN packet along with its DATA. This option should be
|
|
Packit |
875988 |
* followed by an `unsigned int` argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE = 23,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer for the Diffie-Hellman parameters (dh.pem) to be used by the
|
|
Packit |
875988 |
* HTTPS daemon for key exchange.
|
|
Packit |
875988 |
* This option must be followed by a `const char *` argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_MEM_DHPARAMS = 24,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* If present and set to true, allow reusing address:port socket
|
|
Packit |
875988 |
* (by using SO_REUSEPORT on most platform, or platform-specific ways).
|
|
Packit |
875988 |
* If present and set to false, disallow reusing address:port socket
|
|
Packit |
875988 |
* (does nothing on most plaform, but uses SO_EXCLUSIVEADDRUSE on Windows).
|
|
Packit |
875988 |
* This option must be followed by a `unsigned int` argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_LISTENING_ADDRESS_REUSE = 25,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Memory pointer for a password that decrypts the private key (key.pem)
|
|
Packit |
875988 |
* to be used by the HTTPS daemon. This option should be followed by a
|
|
Packit |
875988 |
* `const char *` argument.
|
|
Packit |
875988 |
* This should be used in conjunction with #MHD_OPTION_HTTPS_MEM_KEY.
|
|
Packit |
875988 |
* @sa ::MHD_FEATURE_HTTPS_KEY_PASSWORD
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_HTTPS_KEY_PASSWORD = 26,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Register a function that should be called whenever a connection is
|
|
Packit |
875988 |
* started or closed.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This option should be followed by TWO pointers. First a pointer
|
|
Packit |
875988 |
* to a function of type #MHD_NotifyConnectionCallback and second a
|
|
Packit |
875988 |
* pointer to a closure to pass to the request completed callback.
|
|
Packit |
875988 |
* The second pointer maybe NULL.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_NOTIFY_CONNECTION = 27,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Allow to change maximum length of the queue of pending connections on
|
|
Packit |
875988 |
* listen socket. If not present than default platform-specific SOMAXCONN
|
|
Packit |
875988 |
* value is used. This option should be followed by an `unsigned int`
|
|
Packit |
875988 |
* argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_LISTEN_BACKLOG_SIZE = 28,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* If set to 1 - be strict about the protocol (as opposed to as
|
|
Packit |
875988 |
* tolerant as possible). Specifically, at the moment, this flag
|
|
Packit |
875988 |
* causes MHD to reject HTTP 1.1 connections without a "Host" header.
|
|
Packit |
875988 |
* This is required by the standard, but of course in violation of
|
|
Packit |
875988 |
* the "be as liberal as possible in what you accept" norm. It is
|
|
Packit |
875988 |
* recommended to set this to 1 if you are testing clients against
|
|
Packit |
875988 |
* MHD, and 0 in production.
|
|
Packit |
875988 |
* This option should be followed by an `int` argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_OPTION_STRICT_FOR_CLIENT = 29
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Entry in an #MHD_OPTION_ARRAY.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_OptionItem
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Which option is being given. Use #MHD_OPTION_END
|
|
Packit |
875988 |
* to terminate the array.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_OPTION option;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Option value (for integer arguments, and for options requiring
|
|
Packit |
875988 |
* two pointer arguments); should be 0 for options that take no
|
|
Packit |
875988 |
* arguments or only a single pointer argument.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
intptr_t value;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Pointer option value (use NULL for options taking no arguments
|
|
Packit |
875988 |
* or only an integer option).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
void *ptr_value;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* The `enum MHD_ValueKind` specifies the source of
|
|
Packit |
875988 |
* the key-value pairs in the HTTP protocol.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_ValueKind
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Response header
|
|
Packit |
875988 |
* @deprecated
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RESPONSE_HEADER_KIND = 0,
|
|
Packit |
875988 |
#define MHD_RESPONSE_HEADER_KIND \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \
|
|
Packit |
875988 |
MHD_RESPONSE_HEADER_KIND
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* HTTP header (request/response).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_HEADER_KIND = 1,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Cookies. Note that the original HTTP header containing
|
|
Packit |
875988 |
* the cookie(s) will still be available and intact.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_COOKIE_KIND = 2,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* POST data. This is available only if a content encoding
|
|
Packit |
875988 |
* supported by MHD is used (currently only URL encoding),
|
|
Packit |
875988 |
* and only if the posted content fits within the available
|
|
Packit |
875988 |
* memory pool. Note that in that case, the upload data
|
|
Packit |
875988 |
* given to the #MHD_AccessHandlerCallback will be
|
|
Packit |
875988 |
* empty (since it has already been processed).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_POSTDATA_KIND = 4,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* GET (URI) arguments.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_GET_ARGUMENT_KIND = 8,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* HTTP footer (only for HTTP 1.1 chunked encodings).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FOOTER_KIND = 16
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* The `enum MHD_RequestTerminationCode` specifies reasons
|
|
Packit |
875988 |
* why a request has been terminated (or completed).
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_RequestTerminationCode
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* We finished sending the response.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_REQUEST_TERMINATED_COMPLETED_OK = 0,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Error handling the connection (resources
|
|
Packit |
875988 |
* exhausted, other side closed connection,
|
|
Packit |
875988 |
* application error accepting request, etc.)
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_REQUEST_TERMINATED_WITH_ERROR = 1,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* No activity on the connection for the number
|
|
Packit |
875988 |
* of seconds specified using
|
|
Packit |
875988 |
* #MHD_OPTION_CONNECTION_TIMEOUT.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_REQUEST_TERMINATED_TIMEOUT_REACHED = 2,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* We had to close the session since MHD was being
|
|
Packit |
875988 |
* shut down.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN = 3,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* We tried to read additional data, but the other side closed the
|
|
Packit |
875988 |
* connection. This error is similar to
|
|
Packit |
875988 |
* #MHD_REQUEST_TERMINATED_WITH_ERROR, but specific to the case where
|
|
Packit |
875988 |
* the connection died because the other side did not send expected
|
|
Packit |
875988 |
* data.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_REQUEST_TERMINATED_READ_ERROR = 4,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* The client terminated the connection by closing the socket
|
|
Packit |
875988 |
* for writing (TCP half-closed); MHD aborted sending the
|
|
Packit |
875988 |
* response according to RFC 2616, section 8.1.4.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_REQUEST_TERMINATED_CLIENT_ABORT = 5
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* The `enum MHD_ConnectionNotificationCode` specifies types
|
|
Packit |
875988 |
* of connection notifications.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_ConnectionNotificationCode
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* A new connection has been started.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_NOTIFY_STARTED = 0,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* A connection is closed.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_NOTIFY_CLOSED = 1
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Information about a connection.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
union MHD_ConnectionInfo
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Cipher algorithm used, of type "enum gnutls_cipher_algorithm".
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
int /* enum gnutls_cipher_algorithm */ cipher_algorithm;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Protocol used, of type "enum gnutls_protocol".
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
int /* enum gnutls_protocol */ protocol;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* The suspended status of a connection.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
int /* MHD_YES or MHD_NO */ suspended;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Amount of second that connection could spend in idle state
|
|
Packit |
875988 |
* before automatically disconnected.
|
|
Packit |
875988 |
* Zero for no timeout (unlimited idle time).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
unsigned int connection_timeout;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Connect socket
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_socket connect_fd;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Size of the client's HTTP header.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
size_t header_size;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* GNUtls session handle, of type "gnutls_session_t".
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
void * /* gnutls_session_t */ tls_session;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* GNUtls client certificate handle, of type "gnutls_x509_crt_t".
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
void * /* gnutls_x509_crt_t */ client_cert;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Address information for the client.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct sockaddr *client_addr;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Which daemon manages this connection (useful in case there are many
|
|
Packit |
875988 |
* daemons running).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_Daemon *daemon;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Socket-specific client context. Points to the same address as
|
|
Packit |
875988 |
* the "socket_context" of the #MHD_NotifyConnectionCallback.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
void *socket_context;
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Values of this enum are used to specify what
|
|
Packit |
875988 |
* information about a connection is desired.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_ConnectionInfoType
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* What cipher algorithm is being used.
|
|
Packit |
875988 |
* Takes no extra arguments.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_CIPHER_ALGO,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Takes no extra arguments.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_PROTOCOL,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain IP address of the client. Takes no extra arguments.
|
|
Packit |
875988 |
* Returns essentially a `struct sockaddr **` (since the API returns
|
|
Packit |
875988 |
* a `union MHD_ConnectionInfo *` and that union contains a `struct
|
|
Packit |
875988 |
* sockaddr *`).
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_CLIENT_ADDRESS,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get the gnuTLS session handle.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_GNUTLS_SESSION,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get the gnuTLS client certificate handle. Dysfunctional (never
|
|
Packit |
875988 |
* implemented, deprecated). Use #MHD_CONNECTION_INFO_GNUTLS_SESSION
|
|
Packit |
875988 |
* to get the `gnutls_session_t` and then call
|
|
Packit |
875988 |
* gnutls_certificate_get_peers().
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get the `struct MHD_Daemon *` responsible for managing this connection.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_DAEMON,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Request the file descriptor for the connection socket.
|
|
Packit |
875988 |
* No extra arguments should be passed.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_CONNECTION_FD,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Returns the client-specific pointer to a `void *` that was (possibly)
|
|
Packit |
875988 |
* set during a #MHD_NotifyConnectionCallback when the socket was
|
|
Packit |
875988 |
* first accepted. Note that this is NOT the same as the "con_cls"
|
|
Packit |
875988 |
* argument of the #MHD_AccessHandlerCallback. The "con_cls" is
|
|
Packit |
875988 |
* fresh for each HTTP request, while the "socket_context" is fresh
|
|
Packit |
875988 |
* for each socket.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_SOCKET_CONTEXT,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Check whether the connection is suspended.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_CONNECTION_SUSPENDED,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get connection timeout
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_CONNECTION_TIMEOUT,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Return length of the client's HTTP request header.
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_INFO_REQUEST_HEADER_SIZE
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Values of this enum are used to specify what
|
|
Packit |
875988 |
* information about a deamon is desired.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_DaemonInfoType
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* No longer supported (will return NULL).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_KEY_SIZE,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* No longer supported (will return NULL).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_MAC_KEY_SIZE,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Request the file descriptor for the listening socket.
|
|
Packit |
875988 |
* No extra arguments should be passed.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_LISTEN_FD,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Request the file descriptor for the external epoll.
|
|
Packit |
875988 |
* No extra arguments should be passed.
|
|
Packit |
875988 |
* Waiting on epoll FD must not block longer than value
|
|
Packit |
875988 |
* returned by #MHD_get_timeout().
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY,
|
|
Packit |
875988 |
MHD_DAEMON_INFO_EPOLL_FD = MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Request the number of current connections handled by the daemon.
|
|
Packit |
875988 |
* No extra arguments should be passed.
|
|
Packit |
875988 |
* Note: when using MHD in external polling mode, this type of request
|
|
Packit |
875988 |
* could be used only when #MHD_run()/#MHD_run_from_select is not
|
|
Packit |
875988 |
* working in other thread at the same time.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_CURRENT_CONNECTIONS,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Request the daemon flags.
|
|
Packit |
875988 |
* No extra arguments should be passed.
|
|
Packit |
875988 |
* Note: flags may differ from original 'flags' specified for
|
|
Packit |
875988 |
* daemon, especially if #MHD_USE_AUTO was set.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_FLAGS,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Request the port number of daemon's listen socket.
|
|
Packit |
875988 |
* No extra arguments should be passed.
|
|
Packit |
875988 |
* Note: if port '0' was specified for #MHD_start_daemon(), returned
|
|
Packit |
875988 |
* value will be real port number.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_DAEMON_INFO_BIND_PORT
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Callback for serious error condition. The default action is to print
|
|
Packit |
875988 |
* an error message and `abort()`.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls user specified value
|
|
Packit |
875988 |
* @param file where the error occured
|
|
Packit |
875988 |
* @param line where the error occured
|
|
Packit |
875988 |
* @param reason error detail, may be NULL
|
|
Packit |
875988 |
* @ingroup logging
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef void
|
|
Packit |
875988 |
(*MHD_PanicCallback) (void *cls,
|
|
Packit |
875988 |
const char *file,
|
|
Packit |
875988 |
unsigned int line,
|
|
Packit |
875988 |
const char *reason);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Allow or deny a client to connect.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls closure
|
|
Packit |
875988 |
* @param addr address information from the client
|
|
Packit |
875988 |
* @param addrlen length of @a addr
|
|
Packit |
875988 |
* @return #MHD_YES if connection is allowed, #MHD_NO if not
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef int
|
|
Packit |
875988 |
(*MHD_AcceptPolicyCallback) (void *cls,
|
|
Packit |
875988 |
const struct sockaddr *addr,
|
|
Packit |
875988 |
socklen_t addrlen);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* A client has requested the given url using the given method
|
|
Packit |
875988 |
* (#MHD_HTTP_METHOD_GET, #MHD_HTTP_METHOD_PUT,
|
|
Packit |
875988 |
* #MHD_HTTP_METHOD_DELETE, #MHD_HTTP_METHOD_POST, etc). The callback
|
|
Packit |
875988 |
* must call MHD callbacks to provide content to give back to the
|
|
Packit |
875988 |
* client and return an HTTP status code (i.e. #MHD_HTTP_OK,
|
|
Packit |
875988 |
* #MHD_HTTP_NOT_FOUND, etc.).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls argument given together with the function
|
|
Packit |
875988 |
* pointer when the handler was registered with MHD
|
|
Packit |
875988 |
* @param url the requested url
|
|
Packit |
875988 |
* @param method the HTTP method used (#MHD_HTTP_METHOD_GET,
|
|
Packit |
875988 |
* #MHD_HTTP_METHOD_PUT, etc.)
|
|
Packit |
875988 |
* @param version the HTTP version string (i.e.
|
|
Packit |
875988 |
* #MHD_HTTP_VERSION_1_1)
|
|
Packit |
875988 |
* @param upload_data the data being uploaded (excluding HEADERS,
|
|
Packit |
875988 |
* for a POST that fits into memory and that is encoded
|
|
Packit |
875988 |
* with a supported encoding, the POST data will NOT be
|
|
Packit |
875988 |
* given in upload_data and is instead available as
|
|
Packit |
875988 |
* part of #MHD_get_connection_values; very large POST
|
|
Packit |
875988 |
* data *will* be made available incrementally in
|
|
Packit |
875988 |
* @a upload_data)
|
|
Packit |
875988 |
* @param[in,out] upload_data_size set initially to the size of the
|
|
Packit |
875988 |
* @a upload_data provided; the method must update this
|
|
Packit |
875988 |
* value to the number of bytes NOT processed;
|
|
Packit |
875988 |
* @param[in,out] con_cls pointer that the callback can set to some
|
|
Packit |
875988 |
* address and that will be preserved by MHD for future
|
|
Packit |
875988 |
* calls for this request; since the access handler may
|
|
Packit |
875988 |
* be called many times (i.e., for a PUT/POST operation
|
|
Packit |
875988 |
* with plenty of upload data) this allows the application
|
|
Packit |
875988 |
* to easily associate some request-specific state.
|
|
Packit |
875988 |
* If necessary, this state can be cleaned up in the
|
|
Packit |
875988 |
* global #MHD_RequestCompletedCallback (which
|
|
Packit |
875988 |
* can be set with the #MHD_OPTION_NOTIFY_COMPLETED).
|
|
Packit |
875988 |
* Initially, `*con_cls` will be NULL.
|
|
Packit |
875988 |
* @return #MHD_YES if the connection was handled successfully,
|
|
Packit |
875988 |
* #MHD_NO if the socket must be closed due to a serios
|
|
Packit |
875988 |
* error while handling the request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef int
|
|
Packit |
875988 |
(*MHD_AccessHandlerCallback) (void *cls,
|
|
Packit |
875988 |
struct MHD_Connection *connection,
|
|
Packit |
875988 |
const char *url,
|
|
Packit |
875988 |
const char *method,
|
|
Packit |
875988 |
const char *version,
|
|
Packit |
875988 |
const char *upload_data,
|
|
Packit |
875988 |
size_t *upload_data_size,
|
|
Packit |
875988 |
void **con_cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Signature of the callback used by MHD to notify the
|
|
Packit |
875988 |
* application about completed requests.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls client-defined closure
|
|
Packit |
875988 |
* @param connection connection handle
|
|
Packit |
875988 |
* @param con_cls value as set by the last call to
|
|
Packit |
875988 |
* the #MHD_AccessHandlerCallback
|
|
Packit |
875988 |
* @param toe reason for request termination
|
|
Packit |
875988 |
* @see #MHD_OPTION_NOTIFY_COMPLETED
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef void
|
|
Packit |
875988 |
(*MHD_RequestCompletedCallback) (void *cls,
|
|
Packit |
875988 |
struct MHD_Connection *connection,
|
|
Packit |
875988 |
void **con_cls,
|
|
Packit |
875988 |
enum MHD_RequestTerminationCode toe);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Signature of the callback used by MHD to notify the
|
|
Packit |
875988 |
* application about started/stopped connections
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls client-defined closure
|
|
Packit |
875988 |
* @param connection connection handle
|
|
Packit |
875988 |
* @param socket_context socket-specific pointer where the
|
|
Packit |
875988 |
* client can associate some state specific
|
|
Packit |
875988 |
* to the TCP connection; note that this is
|
|
Packit |
875988 |
* different from the "con_cls" which is per
|
|
Packit |
875988 |
* HTTP request. The client can initialize
|
|
Packit |
875988 |
* during #MHD_CONNECTION_NOTIFY_STARTED and
|
|
Packit |
875988 |
* cleanup during #MHD_CONNECTION_NOTIFY_CLOSED
|
|
Packit |
875988 |
* and access in the meantime using
|
|
Packit |
875988 |
* #MHD_CONNECTION_INFO_SOCKET_CONTEXT.
|
|
Packit |
875988 |
* @param toe reason for connection notification
|
|
Packit |
875988 |
* @see #MHD_OPTION_NOTIFY_CONNECTION
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef void
|
|
Packit |
875988 |
(*MHD_NotifyConnectionCallback) (void *cls,
|
|
Packit |
875988 |
struct MHD_Connection *connection,
|
|
Packit |
875988 |
void **socket_context,
|
|
Packit |
875988 |
enum MHD_ConnectionNotificationCode toe);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Iterator over key-value pairs. This iterator
|
|
Packit |
875988 |
* can be used to iterate over all of the cookies,
|
|
Packit |
875988 |
* headers, or POST-data fields of a request, and
|
|
Packit |
875988 |
* also to iterate over the headers that have been
|
|
Packit |
875988 |
* added to a response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls closure
|
|
Packit |
875988 |
* @param kind kind of the header we are looking at
|
|
Packit |
875988 |
* @param key key for the value, can be an empty string
|
|
Packit |
875988 |
* @param value corresponding value, can be NULL
|
|
Packit |
875988 |
* @return #MHD_YES to continue iterating,
|
|
Packit |
875988 |
* #MHD_NO to abort the iteration
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef int
|
|
Packit |
875988 |
(*MHD_KeyValueIterator) (void *cls,
|
|
Packit |
875988 |
enum MHD_ValueKind kind,
|
|
Packit |
875988 |
const char *key,
|
|
Packit |
875988 |
const char *value);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Callback used by libmicrohttpd in order to obtain content. The
|
|
Packit |
875988 |
* callback is to copy at most @a max bytes of content into @a buf. The
|
|
Packit |
875988 |
* total number of bytes that has been placed into @a buf should be
|
|
Packit |
875988 |
* returned.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Note that returning zero will cause libmicrohttpd to try again.
|
|
Packit |
875988 |
* Thus, returning zero should only be used in conjunction
|
|
Packit |
875988 |
* with MHD_suspend_connection() to avoid busy waiting.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls extra argument to the callback
|
|
Packit |
875988 |
* @param pos position in the datastream to access;
|
|
Packit |
875988 |
* note that if a `struct MHD_Response` object is re-used,
|
|
Packit |
875988 |
* it is possible for the same content reader to
|
|
Packit |
875988 |
* be queried multiple times for the same data;
|
|
Packit |
875988 |
* however, if a `struct MHD_Response` is not re-used,
|
|
Packit |
875988 |
* libmicrohttpd guarantees that "pos" will be
|
|
Packit |
875988 |
* the sum of all non-negative return values
|
|
Packit |
875988 |
* obtained from the content reader so far.
|
|
Packit |
875988 |
* @param buf where to copy the data
|
|
Packit |
875988 |
* @param max maximum number of bytes to copy to @a buf (size of @a buf)
|
|
Packit |
875988 |
* @return number of bytes written to @a buf;
|
|
Packit |
875988 |
* 0 is legal unless we are running in internal select mode (since
|
|
Packit |
875988 |
* this would cause busy-waiting); 0 in external select mode
|
|
Packit |
875988 |
* will cause this function to be called again once the external
|
|
Packit |
875988 |
* select calls MHD again;
|
|
Packit |
875988 |
* #MHD_CONTENT_READER_END_OF_STREAM (-1) for the regular
|
|
Packit |
875988 |
* end of transmission (with chunked encoding, MHD will then
|
|
Packit |
875988 |
* terminate the chunk and send any HTTP footers that might be
|
|
Packit |
875988 |
* present; without chunked encoding and given an unknown
|
|
Packit |
875988 |
* response size, MHD will simply close the connection; note
|
|
Packit |
875988 |
* that while returning #MHD_CONTENT_READER_END_OF_STREAM is not technically
|
|
Packit |
875988 |
* legal if a response size was specified, MHD accepts this
|
|
Packit |
875988 |
* and treats it just as #MHD_CONTENT_READER_END_WITH_ERROR;
|
|
Packit |
875988 |
* #MHD_CONTENT_READER_END_WITH_ERROR (-2) to indicate a server
|
|
Packit |
875988 |
* error generating the response; this will cause MHD to simply
|
|
Packit |
875988 |
* close the connection immediately. If a response size was
|
|
Packit |
875988 |
* given or if chunked encoding is in use, this will indicate
|
|
Packit |
875988 |
* an error to the client. Note, however, that if the client
|
|
Packit |
875988 |
* does not know a response size and chunked encoding is not in
|
|
Packit |
875988 |
* use, then clients will not be able to tell the difference between
|
|
Packit |
875988 |
* #MHD_CONTENT_READER_END_WITH_ERROR and #MHD_CONTENT_READER_END_OF_STREAM.
|
|
Packit |
875988 |
* This is not a limitation of MHD but rather of the HTTP protocol.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef ssize_t
|
|
Packit |
875988 |
(*MHD_ContentReaderCallback) (void *cls,
|
|
Packit |
875988 |
uint64_t pos,
|
|
Packit |
875988 |
char *buf,
|
|
Packit |
875988 |
size_t max);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* This method is called by libmicrohttpd if we
|
|
Packit |
875988 |
* are done with a content reader. It should
|
|
Packit |
875988 |
* be used to free resources associated with the
|
|
Packit |
875988 |
* content reader.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls closure
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef void
|
|
Packit |
875988 |
(*MHD_ContentReaderFreeCallback) (void *cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Iterator over key-value pairs where the value
|
|
Packit |
875988 |
* maybe made available in increments and/or may
|
|
Packit |
875988 |
* not be zero-terminated. Used for processing
|
|
Packit |
875988 |
* POST data.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls user-specified closure
|
|
Packit |
875988 |
* @param kind type of the value, always #MHD_POSTDATA_KIND when called from MHD
|
|
Packit |
875988 |
* @param key 0-terminated key for the value
|
|
Packit |
875988 |
* @param filename name of the uploaded file, NULL if not known
|
|
Packit |
875988 |
* @param content_type mime-type of the data, NULL if not known
|
|
Packit |
875988 |
* @param transfer_encoding encoding of the data, NULL if not known
|
|
Packit |
875988 |
* @param data pointer to @a size bytes of data at the
|
|
Packit |
875988 |
* specified offset
|
|
Packit |
875988 |
* @param off offset of data in the overall value
|
|
Packit |
875988 |
* @param size number of bytes in @a data available
|
|
Packit |
875988 |
* @return #MHD_YES to continue iterating,
|
|
Packit |
875988 |
* #MHD_NO to abort the iteration
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef int
|
|
Packit |
875988 |
(*MHD_PostDataIterator) (void *cls,
|
|
Packit |
875988 |
enum MHD_ValueKind kind,
|
|
Packit |
875988 |
const char *key,
|
|
Packit |
875988 |
const char *filename,
|
|
Packit |
875988 |
const char *content_type,
|
|
Packit |
875988 |
const char *transfer_encoding,
|
|
Packit |
875988 |
const char *data,
|
|
Packit |
875988 |
uint64_t off,
|
|
Packit |
875988 |
size_t size);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* **************** Daemon handling functions ***************** */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Start a webserver on the given port.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param flags combination of `enum MHD_FLAG` values
|
|
Packit |
875988 |
* @param port port to bind to (in host byte order),
|
|
Packit |
875988 |
* use '0' to bind to random free port,
|
|
Packit |
875988 |
* ignored if MHD_OPTION_SOCK_ADDR or
|
|
Packit |
875988 |
* MHD_OPTION_LISTEN_SOCKET is provided
|
|
Packit |
875988 |
* or MHD_USE_NO_LISTEN_SOCKET is specified
|
|
Packit |
875988 |
* @param apc callback to call to check which clients
|
|
Packit |
875988 |
* will be allowed to connect; you can pass NULL
|
|
Packit |
875988 |
* in which case connections from any IP will be
|
|
Packit |
875988 |
* accepted
|
|
Packit |
875988 |
* @param apc_cls extra argument to apc
|
|
Packit |
875988 |
* @param dh handler called for all requests (repeatedly)
|
|
Packit |
875988 |
* @param dh_cls extra argument to @a dh
|
|
Packit |
875988 |
* @param ap list of options (type-value pairs,
|
|
Packit |
875988 |
* terminated with #MHD_OPTION_END).
|
|
Packit |
875988 |
* @return NULL on error, handle to daemon on success
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Daemon *
|
|
Packit |
875988 |
MHD_start_daemon_va (unsigned int flags,
|
|
Packit |
875988 |
uint16_t port,
|
|
Packit |
875988 |
MHD_AcceptPolicyCallback apc, void *apc_cls,
|
|
Packit |
875988 |
MHD_AccessHandlerCallback dh, void *dh_cls,
|
|
Packit |
875988 |
va_list ap);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Start a webserver on the given port. Variadic version of
|
|
Packit |
875988 |
* #MHD_start_daemon_va.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param flags combination of `enum MHD_FLAG` values
|
|
Packit |
875988 |
* @param port port to bind to (in host byte order),
|
|
Packit |
875988 |
* use '0' to bind to random free port,
|
|
Packit |
875988 |
* ignored if MHD_OPTION_SOCK_ADDR or
|
|
Packit |
875988 |
* MHD_OPTION_LISTEN_SOCKET is provided
|
|
Packit |
875988 |
* or MHD_USE_NO_LISTEN_SOCKET is specified
|
|
Packit |
875988 |
* @param apc callback to call to check which clients
|
|
Packit |
875988 |
* will be allowed to connect; you can pass NULL
|
|
Packit |
875988 |
* in which case connections from any IP will be
|
|
Packit |
875988 |
* accepted
|
|
Packit |
875988 |
* @param apc_cls extra argument to apc
|
|
Packit |
875988 |
* @param dh handler called for all requests (repeatedly)
|
|
Packit |
875988 |
* @param dh_cls extra argument to @a dh
|
|
Packit |
875988 |
* @return NULL on error, handle to daemon on success
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Daemon *
|
|
Packit |
875988 |
MHD_start_daemon (unsigned int flags,
|
|
Packit |
875988 |
uint16_t port,
|
|
Packit |
875988 |
MHD_AcceptPolicyCallback apc, void *apc_cls,
|
|
Packit |
875988 |
MHD_AccessHandlerCallback dh, void *dh_cls,
|
|
Packit |
875988 |
...);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Stop accepting connections from the listening socket. Allows
|
|
Packit |
875988 |
* clients to continue processing, but stops accepting new
|
|
Packit |
875988 |
* connections. Note that the caller is responsible for closing the
|
|
Packit |
875988 |
* returned socket; however, if MHD is run using threads (anything but
|
|
Packit |
875988 |
* external select mode), it must not be closed until AFTER
|
|
Packit |
875988 |
* #MHD_stop_daemon has been called (as it is theoretically possible
|
|
Packit |
875988 |
* that an existing thread is still using it).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Note that some thread modes require the caller to have passed
|
|
Packit |
875988 |
* #MHD_USE_ITC when using this API. If this daemon is
|
|
Packit |
875988 |
* in one of those modes and this option was not given to
|
|
Packit |
875988 |
* #MHD_start_daemon, this function will return #MHD_INVALID_SOCKET.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to stop accepting new connections for
|
|
Packit |
875988 |
* @return old listen socket on success, #MHD_INVALID_SOCKET if
|
|
Packit |
875988 |
* the daemon was already not listening anymore
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN MHD_socket
|
|
Packit |
875988 |
MHD_quiesce_daemon (struct MHD_Daemon *daemon);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Shutdown an HTTP daemon.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to stop
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN void
|
|
Packit |
875988 |
MHD_stop_daemon (struct MHD_Daemon *daemon);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Add another client connection to the set of connections managed by
|
|
Packit |
875988 |
* MHD. This API is usually not needed (since MHD will accept inbound
|
|
Packit |
875988 |
* connections on the server socket). Use this API in special cases,
|
|
Packit |
875988 |
* for example if your HTTP server is behind NAT and needs to connect
|
|
Packit |
875988 |
* out to the HTTP client, or if you are building a proxy.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* If you use this API in conjunction with a internal select or a
|
|
Packit |
875988 |
* thread pool, you must set the option
|
|
Packit |
875988 |
* #MHD_USE_ITC to ensure that the freshly added
|
|
Packit |
875988 |
* connection is immediately processed by MHD.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* The given client socket will be managed (and closed!) by MHD after
|
|
Packit |
875988 |
* this call and must no longer be used directly by the application
|
|
Packit |
875988 |
* afterwards.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon that manages the connection
|
|
Packit |
875988 |
* @param client_socket socket to manage (MHD will expect
|
|
Packit |
875988 |
* to receive an HTTP request from this socket next).
|
|
Packit |
875988 |
* @param addr IP address of the client
|
|
Packit |
875988 |
* @param addrlen number of bytes in @a addr
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if this daemon could
|
|
Packit |
875988 |
* not handle the connection (i.e. `malloc()` failed, etc).
|
|
Packit |
875988 |
* The socket will be closed in any case; `errno` is
|
|
Packit |
875988 |
* set to indicate further details about the error.
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_add_connection (struct MHD_Daemon *daemon,
|
|
Packit |
875988 |
MHD_socket client_socket,
|
|
Packit |
875988 |
const struct sockaddr *addr,
|
|
Packit |
875988 |
socklen_t addrlen);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain the `select()` sets for this daemon.
|
|
Packit |
875988 |
* Daemon's FDs will be added to fd_sets. To get only
|
|
Packit |
875988 |
* daemon FDs in fd_sets, call FD_ZERO for each fd_set
|
|
Packit |
875988 |
* before calling this function. FD_SETSIZE is assumed
|
|
Packit |
875988 |
* to be platform's default.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function should only be called in when MHD is configured to
|
|
Packit |
875988 |
* use external select with 'select()' or with 'epoll'.
|
|
Packit |
875988 |
* In the latter case, it will only add the single 'epoll()' file
|
|
Packit |
875988 |
* descriptor used by MHD to the sets.
|
|
Packit |
875988 |
* It's necessary to use #MHD_get_timeout() in combination with
|
|
Packit |
875988 |
* this function.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function must be called only for daemon started
|
|
Packit |
875988 |
* without #MHD_USE_INTERNAL_POLLING_THREAD flag.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to get sets from
|
|
Packit |
875988 |
* @param read_fd_set read set
|
|
Packit |
875988 |
* @param write_fd_set write set
|
|
Packit |
875988 |
* @param except_fd_set except set
|
|
Packit |
875988 |
* @param max_fd increased to largest FD added (if larger
|
|
Packit |
875988 |
* than existing value); can be NULL
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if this
|
|
Packit |
875988 |
* daemon was not started with the right
|
|
Packit |
875988 |
* options for this call or any FD didn't
|
|
Packit |
875988 |
* fit fd_set.
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_get_fdset (struct MHD_Daemon *daemon,
|
|
Packit |
875988 |
fd_set *read_fd_set,
|
|
Packit |
875988 |
fd_set *write_fd_set,
|
|
Packit |
875988 |
fd_set *except_fd_set,
|
|
Packit |
875988 |
MHD_socket *max_fd);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain the `select()` sets for this daemon.
|
|
Packit |
875988 |
* Daemon's FDs will be added to fd_sets. To get only
|
|
Packit |
875988 |
* daemon FDs in fd_sets, call FD_ZERO for each fd_set
|
|
Packit |
875988 |
* before calling this function.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Passing custom FD_SETSIZE as @a fd_setsize allow usage of
|
|
Packit |
875988 |
* larger/smaller than platform's default fd_sets.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function should only be called in when MHD is configured to
|
|
Packit |
875988 |
* use external select with 'select()' or with 'epoll'.
|
|
Packit |
875988 |
* In the latter case, it will only add the single 'epoll' file
|
|
Packit |
875988 |
* descriptor used by MHD to the sets.
|
|
Packit |
875988 |
* It's necessary to use #MHD_get_timeout() in combination with
|
|
Packit |
875988 |
* this function.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function must be called only for daemon started
|
|
Packit |
875988 |
* without #MHD_USE_INTERNAL_POLLING_THREAD flag.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to get sets from
|
|
Packit |
875988 |
* @param read_fd_set read set
|
|
Packit |
875988 |
* @param write_fd_set write set
|
|
Packit |
875988 |
* @param except_fd_set except set
|
|
Packit |
875988 |
* @param max_fd increased to largest FD added (if larger
|
|
Packit |
875988 |
* than existing value); can be NULL
|
|
Packit |
875988 |
* @param fd_setsize value of FD_SETSIZE
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if this
|
|
Packit |
875988 |
* daemon was not started with the right
|
|
Packit |
875988 |
* options for this call or any FD didn't
|
|
Packit |
875988 |
* fit fd_set.
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_get_fdset2 (struct MHD_Daemon *daemon,
|
|
Packit |
875988 |
fd_set *read_fd_set,
|
|
Packit |
875988 |
fd_set *write_fd_set,
|
|
Packit |
875988 |
fd_set *except_fd_set,
|
|
Packit |
875988 |
MHD_socket *max_fd,
|
|
Packit |
875988 |
unsigned int fd_setsize);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain the `select()` sets for this daemon.
|
|
Packit |
875988 |
* Daemon's FDs will be added to fd_sets. To get only
|
|
Packit |
875988 |
* daemon FDs in fd_sets, call FD_ZERO for each fd_set
|
|
Packit |
875988 |
* before calling this function. Size of fd_set is
|
|
Packit |
875988 |
* determined by current value of FD_SETSIZE.
|
|
Packit |
875988 |
* It's necessary to use #MHD_get_timeout() in combination with
|
|
Packit |
875988 |
* this function.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function could be called only for daemon started
|
|
Packit |
875988 |
* without #MHD_USE_INTERNAL_POLLING_THREAD flag.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to get sets from
|
|
Packit |
875988 |
* @param read_fd_set read set
|
|
Packit |
875988 |
* @param write_fd_set write set
|
|
Packit |
875988 |
* @param except_fd_set except set
|
|
Packit |
875988 |
* @param max_fd increased to largest FD added (if larger
|
|
Packit |
875988 |
* than existing value); can be NULL
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if this
|
|
Packit |
875988 |
* daemon was not started with the right
|
|
Packit |
875988 |
* options for this call or any FD didn't
|
|
Packit |
875988 |
* fit fd_set.
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \
|
|
Packit |
875988 |
MHD_get_fdset2((daemon),(read_fd_set),(write_fd_set),(except_fd_set),(max_fd),FD_SETSIZE)
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain timeout value for polling function for this daemon.
|
|
Packit |
875988 |
* This function set value to amount of milliseconds for which polling
|
|
Packit |
875988 |
* function (`select()` or `poll()`) should at most block, not the
|
|
Packit |
875988 |
* timeout value set for connections.
|
|
Packit |
875988 |
* It is important to always use this function, even if connection
|
|
Packit |
875988 |
* timeout is not set, as in some cases MHD may already have more
|
|
Packit |
875988 |
* data to process on next turn (data pending in TLS buffers,
|
|
Packit |
875988 |
* connections are already ready with epoll etc.) and returned timeout
|
|
Packit |
875988 |
* will be zero.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to query for timeout
|
|
Packit |
875988 |
* @param timeout set to the timeout (in milliseconds)
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if timeouts are
|
|
Packit |
875988 |
* not used (or no connections exist that would
|
|
Packit |
875988 |
* necessitate the use of a timeout right now).
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_get_timeout (struct MHD_Daemon *daemon,
|
|
Packit |
875988 |
MHD_UNSIGNED_LONG_LONG *timeout);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run webserver operations (without blocking unless in client
|
|
Packit |
875988 |
* callbacks). This method should be called by clients in combination
|
|
Packit |
875988 |
* with #MHD_get_fdset if the client-controlled select method is used and
|
|
Packit |
875988 |
* #MHD_get_timeout().
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function is a convenience method, which is useful if the
|
|
Packit |
875988 |
* fd_sets from #MHD_get_fdset were not directly passed to `select()`;
|
|
Packit |
875988 |
* with this function, MHD will internally do the appropriate `select()`
|
|
Packit |
875988 |
* call itself again. While it is always safe to call #MHD_run (if
|
|
Packit |
875988 |
* #MHD_USE_INTERNAL_POLLING_THREAD is not set), you should call
|
|
Packit |
875988 |
* #MHD_run_from_select if performance is important (as it saves an
|
|
Packit |
875988 |
* expensive call to `select()`).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to run
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if this
|
|
Packit |
875988 |
* daemon was not started with the right
|
|
Packit |
875988 |
* options for this call.
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_run (struct MHD_Daemon *daemon);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Run webserver operations. This method should be called by clients
|
|
Packit |
875988 |
* in combination with #MHD_get_fdset and #MHD_get_timeout() if the
|
|
Packit |
875988 |
* client-controlled select method is used.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* You can use this function instead of #MHD_run if you called
|
|
Packit |
875988 |
* `select()` on the result from #MHD_get_fdset. File descriptors in
|
|
Packit |
875988 |
* the sets that are not controlled by MHD will be ignored. Calling
|
|
Packit |
875988 |
* this function instead of #MHD_run is more efficient as MHD will
|
|
Packit |
875988 |
* not have to call `select()` again to determine which operations are
|
|
Packit |
875988 |
* ready.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function cannot be used with daemon started with
|
|
Packit |
875988 |
* #MHD_USE_INTERNAL_POLLING_THREAD flag.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon daemon to run select loop for
|
|
Packit |
875988 |
* @param read_fd_set read set
|
|
Packit |
875988 |
* @param write_fd_set write set
|
|
Packit |
875988 |
* @param except_fd_set except set
|
|
Packit |
875988 |
* @return #MHD_NO on serious errors, #MHD_YES on success
|
|
Packit |
875988 |
* @ingroup event
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_run_from_select (struct MHD_Daemon *daemon,
|
|
Packit |
875988 |
const fd_set *read_fd_set,
|
|
Packit |
875988 |
const fd_set *write_fd_set,
|
|
Packit |
875988 |
const fd_set *except_fd_set);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* **************** Connection handling functions ***************** */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get all of the headers from the request.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection connection to get values from
|
|
Packit |
875988 |
* @param kind types of values to iterate over, can be a bitmask
|
|
Packit |
875988 |
* @param iterator callback to call on each header;
|
|
Packit |
875988 |
* maybe NULL (then just count headers)
|
|
Packit |
875988 |
* @param iterator_cls extra argument to @a iterator
|
|
Packit |
875988 |
* @return number of entries iterated over
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_get_connection_values (struct MHD_Connection *connection,
|
|
Packit |
875988 |
enum MHD_ValueKind kind,
|
|
Packit |
875988 |
MHD_KeyValueIterator iterator,
|
|
Packit |
875988 |
void *iterator_cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* This function can be used to add an entry to the HTTP headers of a
|
|
Packit |
875988 |
* connection (so that the #MHD_get_connection_values function will
|
|
Packit |
875988 |
* return them -- and the `struct MHD_PostProcessor` will also see
|
|
Packit |
875988 |
* them). This maybe required in certain situations (see Mantis
|
|
Packit |
875988 |
* #1399) where (broken) HTTP implementations fail to supply values
|
|
Packit |
875988 |
|
|
Packit |
875988 |
* needed by the post processor (or other parts of the application).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This function MUST only be called from within the
|
|
Packit |
875988 |
* #MHD_AccessHandlerCallback (otherwise, access maybe improperly
|
|
Packit |
875988 |
* synchronized). Furthermore, the client must guarantee that the key
|
|
Packit |
875988 |
* and value arguments are 0-terminated strings that are NOT freed
|
|
Packit |
875988 |
* until the connection is closed. (The easiest way to do this is by
|
|
Packit |
875988 |
* passing only arguments to permanently allocated strings.).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection the connection for which a
|
|
Packit |
875988 |
* value should be set
|
|
Packit |
875988 |
* @param kind kind of the value
|
|
Packit |
875988 |
* @param key key for the value
|
|
Packit |
875988 |
* @param value the value itself
|
|
Packit |
875988 |
* @return #MHD_NO if the operation could not be
|
|
Packit |
875988 |
* performed due to insufficient memory;
|
|
Packit |
875988 |
* #MHD_YES on success
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_set_connection_value (struct MHD_Connection *connection,
|
|
Packit |
875988 |
enum MHD_ValueKind kind,
|
|
Packit |
875988 |
const char *key,
|
|
Packit |
875988 |
const char *value);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Sets the global error handler to a different implementation. @a cb
|
|
Packit |
875988 |
* will only be called in the case of typically fatal, serious
|
|
Packit |
875988 |
* internal consistency issues. These issues should only arise in the
|
|
Packit |
875988 |
* case of serious memory corruption or similar problems with the
|
|
Packit |
875988 |
* architecture. While @a cb is allowed to return and MHD will then
|
|
Packit |
875988 |
* try to continue, this is never safe.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* The default implementation that is used if no panic function is set
|
|
Packit |
875988 |
* simply prints an error message and calls `abort()`. Alternative
|
|
Packit |
875988 |
* implementations might call `exit()` or other similar functions.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cb new error handler
|
|
Packit |
875988 |
* @param cls passed to @a cb
|
|
Packit |
875988 |
* @ingroup logging
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN void
|
|
Packit |
875988 |
MHD_set_panic_func (MHD_PanicCallback cb, void *cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Process escape sequences ('%HH') Updates val in place; the
|
|
Packit |
875988 |
* result should be UTF-8 encoded and cannot be larger than the input.
|
|
Packit |
875988 |
* The result must also still be 0-terminated.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param val value to unescape (modified in the process)
|
|
Packit |
875988 |
* @return length of the resulting val (`strlen(val)` may be
|
|
Packit |
875988 |
* shorter afterwards due to elimination of escape sequences)
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN size_t
|
|
Packit |
875988 |
MHD_http_unescape (char *val);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get a particular header value. If multiple
|
|
Packit |
875988 |
* values match the kind, return any one of them.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection connection to get values from
|
|
Packit |
875988 |
* @param kind what kind of value are we looking for
|
|
Packit |
875988 |
* @param key the header to look for, NULL to lookup 'trailing' value without a key
|
|
Packit |
875988 |
* @return NULL if no such item was found
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN const char *
|
|
Packit |
875988 |
MHD_lookup_connection_value (struct MHD_Connection *connection,
|
|
Packit |
875988 |
enum MHD_ValueKind kind,
|
|
Packit |
875988 |
const char *key);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Queue a response to be transmitted to the client (as soon as
|
|
Packit |
875988 |
* possible but after #MHD_AccessHandlerCallback returns).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection the connection identifying the client
|
|
Packit |
875988 |
* @param status_code HTTP status code (i.e. #MHD_HTTP_OK)
|
|
Packit |
875988 |
* @param response response to transmit
|
|
Packit |
875988 |
* @return #MHD_NO on error (i.e. reply already sent),
|
|
Packit |
875988 |
* #MHD_YES on success or if message has been queued
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_queue_response (struct MHD_Connection *connection,
|
|
Packit |
875988 |
unsigned int status_code,
|
|
Packit |
875988 |
struct MHD_Response *response);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Suspend handling of network data for a given connection. This can
|
|
Packit |
875988 |
* be used to dequeue a connection from MHD's event loop for a while.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* If you use this API in conjunction with a internal select or a
|
|
Packit |
875988 |
* thread pool, you must set the option #MHD_USE_ITC to
|
|
Packit |
875988 |
* ensure that a resumed connection is immediately processed by MHD.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Suspended connections continue to count against the total number of
|
|
Packit |
875988 |
* connections allowed (per daemon, as well as per IP, if such limits
|
|
Packit |
875988 |
* are set). Suspended connections will NOT time out; timeouts will
|
|
Packit |
875988 |
* restart when the connection handling is resumed. While a
|
|
Packit |
875988 |
* connection is suspended, MHD will not detect disconnects by the
|
|
Packit |
875988 |
* client.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* The only safe time to suspend a connection is from the
|
|
Packit |
875988 |
* #MHD_AccessHandlerCallback.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Finally, it is an API violation to call #MHD_stop_daemon while
|
|
Packit |
875988 |
* having suspended connections (this will at least create memory and
|
|
Packit |
875988 |
* socket leaks or lead to undefined behavior). You must explicitly
|
|
Packit |
875988 |
* resume all connections before stopping the daemon.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection the connection to suspend
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN void
|
|
Packit |
875988 |
MHD_suspend_connection (struct MHD_Connection *connection);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Resume handling of network data for suspended connection. It is
|
|
Packit |
875988 |
* safe to resume a suspended connection at any time. Calling this
|
|
Packit |
875988 |
* function on a connection that was not previously suspended will
|
|
Packit |
875988 |
* result in undefined behavior.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* If you are using this function in ``external'' select mode, you must
|
|
Packit |
875988 |
* make sure to run #MHD_run() afterwards (before again calling
|
|
Packit |
875988 |
* #MHD_get_fdset(), as otherwise the change may not be reflected in
|
|
Packit |
875988 |
* the set returned by #MHD_get_fdset() and you may end up with a
|
|
Packit |
875988 |
* connection that is stuck until the next network activity.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection the connection to resume
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN void
|
|
Packit |
875988 |
MHD_resume_connection (struct MHD_Connection *connection);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* **************** Response manipulation functions ***************** */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Flags for special handling of responses.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_ResponseFlags
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Default: no special flags.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RF_NONE = 0,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Only respond in conservative HTTP 1.0-mode. In particular,
|
|
Packit |
875988 |
* do not (automatically) sent "Connection" headers and always
|
|
Packit |
875988 |
* close the connection after generating the response.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RF_HTTP_VERSION_1_0_ONLY = 1
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* MHD options (for future extensions).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_ResponseOptions
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* End of the list of options.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RO_END = 0
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Set special flags and options for a response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response the response to modify
|
|
Packit |
875988 |
* @param flags to set for the response
|
|
Packit |
875988 |
* @param ... #MHD_RO_END terminated list of options
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO on error
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_set_response_options (struct MHD_Response *response,
|
|
Packit |
875988 |
enum MHD_ResponseFlags flags,
|
|
Packit |
875988 |
...);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the data portion of the response, #MHD_SIZE_UNKNOWN for unknown
|
|
Packit |
875988 |
* @param block_size preferred block size for querying crc (advisory only,
|
|
Packit |
875988 |
* MHD may still call @a crc using smaller chunks); this
|
|
Packit |
875988 |
* is essentially the buffer size used for IO, clients
|
|
Packit |
875988 |
* should pick a value that is appropriate for IO and
|
|
Packit |
875988 |
* memory performance requirements
|
|
Packit |
875988 |
* @param crc callback to use to obtain response data
|
|
Packit |
875988 |
* @param crc_cls extra argument to @a crc
|
|
Packit |
875988 |
* @param crfc callback to call to free @a crc_cls resources
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_callback (uint64_t size,
|
|
Packit |
875988 |
size_t block_size,
|
|
Packit |
875988 |
MHD_ContentReaderCallback crc, void *crc_cls,
|
|
Packit |
875988 |
MHD_ContentReaderFreeCallback crfc);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the @a data portion of the response
|
|
Packit |
875988 |
* @param data the data itself
|
|
Packit |
875988 |
* @param must_free libmicrohttpd should free data when done
|
|
Packit |
875988 |
* @param must_copy libmicrohttpd must make a copy of @a data
|
|
Packit |
875988 |
* right away, the data maybe released anytime after
|
|
Packit |
875988 |
* this call returns
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @deprecated use #MHD_create_response_from_buffer instead
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_DEPR_FUNC("MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_data (size_t size,
|
|
Packit |
875988 |
void *data,
|
|
Packit |
875988 |
int must_free,
|
|
Packit |
875988 |
int must_copy);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Specification for how MHD should treat the memory buffer
|
|
Packit |
875988 |
* given for the response.
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_ResponseMemoryMode
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Buffer is a persistent (static/global) buffer that won't change
|
|
Packit |
875988 |
* for at least the lifetime of the response, MHD should just use
|
|
Packit |
875988 |
* it, not free it, not copy it, just keep an alias to it.
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RESPMEM_PERSISTENT,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Buffer is heap-allocated with `malloc()` (or equivalent) and
|
|
Packit |
875988 |
* should be freed by MHD after processing the response has
|
|
Packit |
875988 |
* concluded (response reference counter reaches zero).
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RESPMEM_MUST_FREE,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Buffer is in transient memory, but not on the heap (for example,
|
|
Packit |
875988 |
* on the stack or non-`malloc()` allocated) and only valid during the
|
|
Packit |
875988 |
* call to #MHD_create_response_from_buffer. MHD must make its
|
|
Packit |
875988 |
* own private copy of the data for processing.
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_RESPMEM_MUST_COPY
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the data portion of the response
|
|
Packit |
875988 |
* @param buffer size bytes containing the response's data portion
|
|
Packit |
875988 |
* @param mode flags for buffer management
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_buffer (size_t size,
|
|
Packit |
875988 |
void *buffer,
|
|
Packit |
875988 |
enum MHD_ResponseMemoryMode mode);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the data portion of the response
|
|
Packit |
875988 |
* @param fd file descriptor referring to a file on disk with the
|
|
Packit |
875988 |
* data; will be closed when response is destroyed;
|
|
Packit |
875988 |
* fd should be in 'blocking' mode
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_fd (size_t size,
|
|
Packit |
875988 |
int fd);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the data portion of the response;
|
|
Packit |
875988 |
* sizes larger than 2 GiB may be not supported by OS or
|
|
Packit |
875988 |
* MHD build; see ::MHD_FEATURE_LARGE_FILE
|
|
Packit |
875988 |
* @param fd file descriptor referring to a file on disk with the
|
|
Packit |
875988 |
* data; will be closed when response is destroyed;
|
|
Packit |
875988 |
* fd should be in 'blocking' mode
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_fd64 (uint64_t size,
|
|
Packit |
875988 |
int fd);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the data portion of the response
|
|
Packit |
875988 |
* @param fd file descriptor referring to a file on disk with the
|
|
Packit |
875988 |
* data; will be closed when response is destroyed;
|
|
Packit |
875988 |
* fd should be in 'blocking' mode
|
|
Packit |
875988 |
* @param offset offset to start reading from in the file;
|
|
Packit |
875988 |
* Be careful! `off_t` may have been compiled to be a
|
|
Packit |
875988 |
* 64-bit variable for MHD, in which case your application
|
|
Packit |
875988 |
* also has to be compiled using the same options! Read
|
|
Packit |
875988 |
* the MHD manual for more details.
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_DEPR_FUNC("Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_fd_at_offset (size_t size,
|
|
Packit |
875988 |
int fd,
|
|
Packit |
875988 |
off_t offset);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if !defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC)
|
|
Packit |
875988 |
/* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset()
|
|
Packit |
875988 |
to minimize potential problems with different off_t sizes */
|
|
Packit |
875988 |
#define MHD_create_response_from_fd_at_offset(size,fd,offset) \
|
|
Packit |
875988 |
_MHD_DEPR_IN_MACRO("Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
|
|
Packit |
875988 |
MHD_create_response_from_fd_at_offset64((size),(fd),(offset))
|
|
Packit |
875988 |
#endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object. The response object can be extended with
|
|
Packit |
875988 |
* header information and then be used any number of times.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param size size of the data portion of the response;
|
|
Packit |
875988 |
* sizes larger than 2 GiB may be not supported by OS or
|
|
Packit |
875988 |
* MHD build; see ::MHD_FEATURE_LARGE_FILE
|
|
Packit |
875988 |
* @param fd file descriptor referring to a file on disk with the
|
|
Packit |
875988 |
* data; will be closed when response is destroyed;
|
|
Packit |
875988 |
* fd should be in 'blocking' mode
|
|
Packit |
875988 |
* @param offset offset to start reading from in the file;
|
|
Packit |
875988 |
* reading file beyond 2 GiB may be not supported by OS or
|
|
Packit |
875988 |
* MHD build; see ::MHD_FEATURE_LARGE_FILE
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_from_fd_at_offset64 (uint64_t size,
|
|
Packit |
875988 |
int fd,
|
|
Packit |
875988 |
uint64_t offset);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Enumeration for actions MHD should perform on the underlying socket
|
|
Packit |
875988 |
* of the upgrade. This API is not finalized, and in particular
|
|
Packit |
875988 |
* the final set of actions is yet to be decided. This is just an
|
|
Packit |
875988 |
* idea for what we might want.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_UpgradeAction
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Close the socket, the application is done with it.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Takes no extra arguments.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_UPGRADE_ACTION_CLOSE = 0
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Handle given to the application to manage special
|
|
Packit |
875988 |
* actions relating to MHD responses that "upgrade"
|
|
Packit |
875988 |
* the HTTP protocol (i.e. to WebSockets).
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
struct MHD_UpgradeResponseHandle;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* This connection-specific callback is provided by MHD to
|
|
Packit |
875988 |
* applications (unusual) during the #MHD_UpgradeHandler.
|
|
Packit |
875988 |
* It allows applications to perform 'special' actions on
|
|
Packit |
875988 |
* the underlying socket from the upgrade.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param urh the handle identifying the connection to perform
|
|
Packit |
875988 |
* the upgrade @a action on.
|
|
Packit |
875988 |
* @param action which action should be performed
|
|
Packit |
875988 |
* @param ... arguments to the action (depends on the action)
|
|
Packit |
875988 |
* @return #MHD_NO on error, #MHD_YES on success
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
|
|
Packit |
875988 |
enum MHD_UpgradeAction action,
|
|
Packit |
875988 |
...);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Function called after a protocol "upgrade" response was sent
|
|
Packit |
875988 |
* successfully and the socket should now be controlled by some
|
|
Packit |
875988 |
* protocol other than HTTP.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Any data already received on the socket will be made available in
|
|
Packit |
875988 |
* @e extra_in. This can happen if the application sent extra data
|
|
Packit |
875988 |
* before MHD send the upgrade response. The application should
|
|
Packit |
875988 |
* treat data from @a extra_in as if it had read it from the socket.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Note that the application must not close() @a sock directly,
|
|
Packit |
875988 |
* but instead use #MHD_upgrade_action() for special operations
|
|
Packit |
875988 |
* on @a sock.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Data forwarding to "upgraded" @a sock will be started as soon
|
|
Packit |
875988 |
* as this function return.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Except when in 'thread-per-connection' mode, implementations
|
|
Packit |
875988 |
* of this function should never block (as it will still be called
|
|
Packit |
875988 |
* from within the main event loop).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param cls closure, whatever was given to #MHD_create_response_for_upgrade().
|
|
Packit |
875988 |
* @param connection original HTTP connection handle,
|
|
Packit |
875988 |
* giving the function a last chance
|
|
Packit |
875988 |
* to inspect the original HTTP request
|
|
Packit |
875988 |
* @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback`
|
|
Packit |
875988 |
* @param extra_in if we happened to have read bytes after the
|
|
Packit |
875988 |
* HTTP header already (because the client sent
|
|
Packit |
875988 |
* more than the HTTP header of the request before
|
|
Packit |
875988 |
* we sent the upgrade response),
|
|
Packit |
875988 |
* these are the extra bytes already read from @a sock
|
|
Packit |
875988 |
* by MHD. The application should treat these as if
|
|
Packit |
875988 |
* it had read them from @a sock.
|
|
Packit |
875988 |
* @param extra_in_size number of bytes in @a extra_in
|
|
Packit |
875988 |
* @param sock socket to use for bi-directional communication
|
|
Packit |
875988 |
* with the client. For HTTPS, this may not be a socket
|
|
Packit |
875988 |
* that is directly connected to the client and thus certain
|
|
Packit |
875988 |
* operations (TCP-specific setsockopt(), getsockopt(), etc.)
|
|
Packit |
875988 |
* may not work as expected (as the socket could be from a
|
|
Packit |
875988 |
* socketpair() or a TCP-loopback). The application is expected
|
|
Packit |
875988 |
* to perform read()/recv() and write()/send() calls on the socket.
|
|
Packit |
875988 |
* The application may also call shutdown(), but must not call
|
|
Packit |
875988 |
* close() directly.
|
|
Packit |
875988 |
* @param urh argument for #MHD_upgrade_action()s on this @a connection.
|
|
Packit |
875988 |
* Applications must eventually use this callback to (indirectly)
|
|
Packit |
875988 |
* perform the close() action on the @a sock.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
typedef void
|
|
Packit |
875988 |
(*MHD_UpgradeHandler)(void *cls,
|
|
Packit |
875988 |
struct MHD_Connection *connection,
|
|
Packit |
875988 |
void *con_cls,
|
|
Packit |
875988 |
const char *extra_in,
|
|
Packit |
875988 |
size_t extra_in_size,
|
|
Packit |
875988 |
MHD_socket sock,
|
|
Packit |
875988 |
struct MHD_UpgradeResponseHandle *urh);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a response object that can be used for 101 UPGRADE
|
|
Packit |
875988 |
* responses, for example to implement WebSockets. After sending the
|
|
Packit |
875988 |
* response, control over the data stream is given to the callback (which
|
|
Packit |
875988 |
* can then, for example, start some bi-directional communication).
|
|
Packit |
875988 |
* If the response is queued for multiple connections, the callback
|
|
Packit |
875988 |
* will be called for each connection. The callback
|
|
Packit |
875988 |
* will ONLY be called after the response header was successfully passed
|
|
Packit |
875988 |
* to the OS; if there are communication errors before, the usual MHD
|
|
Packit |
875988 |
* connection error handling code will be performed.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* Setting the correct HTTP code (i.e. MHD_HTTP_SWITCHING_PROTOCOLS)
|
|
Packit |
875988 |
* and setting correct HTTP headers for the upgrade must be done
|
|
Packit |
875988 |
* manually (this way, it is possible to implement most existing
|
|
Packit |
875988 |
* WebSocket versions using this API; in fact, this API might be useful
|
|
Packit |
875988 |
* for any protocol switch, not just WebSockets). Note that
|
|
Packit |
875988 |
* draft-ietf-hybi-thewebsocketprotocol-00 cannot be implemented this
|
|
Packit |
875988 |
* way as the header "HTTP/1.1 101 WebSocket Protocol Handshake"
|
|
Packit |
875988 |
* cannot be generated; instead, MHD will always produce "HTTP/1.1 101
|
|
Packit |
875988 |
* Switching Protocols" (if the response code 101 is used).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* As usual, the response object can be extended with header
|
|
Packit |
875988 |
* information and then be used any number of times (as long as the
|
|
Packit |
875988 |
* header information is not connection-specific).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param upgrade_handler function to call with the "upgraded" socket
|
|
Packit |
875988 |
* @param upgrade_handler_cls closure for @a upgrade_handler
|
|
Packit |
875988 |
* @return NULL on error (i.e. invalid arguments, out of memory)
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_Response *
|
|
Packit |
875988 |
MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
|
|
Packit |
875988 |
void *upgrade_handler_cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Destroy a response object and associated resources. Note that
|
|
Packit |
875988 |
* libmicrohttpd may keep some of the resources around if the response
|
|
Packit |
875988 |
* is still in the queue for some clients, so the memory may not
|
|
Packit |
875988 |
* necessarily be freed immediatley.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response response to destroy
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN void
|
|
Packit |
875988 |
MHD_destroy_response (struct MHD_Response *response);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Add a header line to the response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response response to add a header to
|
|
Packit |
875988 |
* @param header the header to add
|
|
Packit |
875988 |
* @param content value to add
|
|
Packit |
875988 |
* @return #MHD_NO on error (i.e. invalid header or content format),
|
|
Packit |
875988 |
* or out of memory
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_add_response_header (struct MHD_Response *response,
|
|
Packit |
875988 |
const char *header,
|
|
Packit |
875988 |
const char *content);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Add a footer line to the response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response response to remove a header from
|
|
Packit |
875988 |
* @param footer the footer to delete
|
|
Packit |
875988 |
* @param content value to delete
|
|
Packit |
875988 |
* @return #MHD_NO on error (i.e. invalid footer or content format).
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_add_response_footer (struct MHD_Response *response,
|
|
Packit |
875988 |
const char *footer,
|
|
Packit |
875988 |
const char *content);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Delete a header (or footer) line from the response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response response to remove a header from
|
|
Packit |
875988 |
* @param header the header to delete
|
|
Packit |
875988 |
* @param content value to delete
|
|
Packit |
875988 |
* @return #MHD_NO on error (no such header known)
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_del_response_header (struct MHD_Response *response,
|
|
Packit |
875988 |
const char *header,
|
|
Packit |
875988 |
const char *content);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get all of the headers (and footers) added to a response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response response to query
|
|
Packit |
875988 |
* @param iterator callback to call on each header;
|
|
Packit |
875988 |
* maybe NULL (then just count headers)
|
|
Packit |
875988 |
* @param iterator_cls extra argument to @a iterator
|
|
Packit |
875988 |
* @return number of entries iterated over
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_get_response_headers (struct MHD_Response *response,
|
|
Packit |
875988 |
MHD_KeyValueIterator iterator, void *iterator_cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get a particular header (or footer) from the response.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param response response to query
|
|
Packit |
875988 |
* @param key which header to get
|
|
Packit |
875988 |
* @return NULL if header does not exist
|
|
Packit |
875988 |
* @ingroup response
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN const char *
|
|
Packit |
875988 |
MHD_get_response_header (struct MHD_Response *response,
|
|
Packit |
875988 |
const char *key);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* ********************** PostProcessor functions ********************** */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Create a `struct MHD_PostProcessor`.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* A `struct MHD_PostProcessor` can be used to (incrementally) parse
|
|
Packit |
875988 |
* the data portion of a POST request. Note that some buggy browsers
|
|
Packit |
875988 |
* fail to set the encoding type. If you want to support those, you
|
|
Packit |
875988 |
* may have to call #MHD_set_connection_value with the proper encoding
|
|
Packit |
875988 |
* type before creating a post processor (if no supported encoding
|
|
Packit |
875988 |
* type is set, this function will fail).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection the connection on which the POST is
|
|
Packit |
875988 |
* happening (used to determine the POST format)
|
|
Packit |
875988 |
* @param buffer_size maximum number of bytes to use for
|
|
Packit |
875988 |
* internal buffering (used only for the parsing,
|
|
Packit |
875988 |
* specifically the parsing of the keys). A
|
|
Packit |
875988 |
* tiny value (256-1024) should be sufficient.
|
|
Packit |
875988 |
* Do NOT use a value smaller than 256. For good
|
|
Packit |
875988 |
* performance, use 32 or 64k (i.e. 65536).
|
|
Packit |
875988 |
* @param iter iterator to be called with the parsed data,
|
|
Packit |
875988 |
* Must NOT be NULL.
|
|
Packit |
875988 |
* @param iter_cls first argument to @a iter
|
|
Packit |
875988 |
* @return NULL on error (out of memory, unsupported encoding),
|
|
Packit |
875988 |
* otherwise a PP handle
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN struct MHD_PostProcessor *
|
|
Packit |
875988 |
MHD_create_post_processor (struct MHD_Connection *connection,
|
|
Packit |
875988 |
size_t buffer_size,
|
|
Packit |
875988 |
MHD_PostDataIterator iter, void *iter_cls);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Parse and process POST data. Call this function when POST data is
|
|
Packit |
875988 |
* available (usually during an #MHD_AccessHandlerCallback) with the
|
|
Packit |
875988 |
* "upload_data" and "upload_data_size". Whenever possible, this will
|
|
Packit |
875988 |
* then cause calls to the #MHD_PostDataIterator.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param pp the post processor
|
|
Packit |
875988 |
* @param post_data @a post_data_len bytes of POST data
|
|
Packit |
875988 |
* @param post_data_len length of @a post_data
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO on error
|
|
Packit |
875988 |
* (out-of-memory, iterator aborted, parse error)
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_post_process (struct MHD_PostProcessor *pp,
|
|
Packit |
875988 |
const char *post_data, size_t post_data_len);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Release PostProcessor resources.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param pp the PostProcessor to destroy
|
|
Packit |
875988 |
* @return #MHD_YES if processing completed nicely,
|
|
Packit |
875988 |
* #MHD_NO if there were spurious characters / formatting
|
|
Packit |
875988 |
* problems; it is common to ignore the return
|
|
Packit |
875988 |
* value of this function
|
|
Packit |
875988 |
* @ingroup request
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_destroy_post_processor (struct MHD_PostProcessor *pp);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* ********************* Digest Authentication functions *************** */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Constant to indicate that the nonce of the provided
|
|
Packit |
875988 |
* authentication code was wrong.
|
|
Packit |
875988 |
* @ingroup authentication
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define MHD_INVALID_NONCE -1
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get the username from the authorization header sent by the client
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection The MHD connection structure
|
|
Packit |
875988 |
* @return NULL if no username could be found, a pointer
|
|
Packit |
875988 |
* to the username if found, free using #MHD_free().
|
|
Packit |
875988 |
* @ingroup authentication
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN char *
|
|
Packit |
875988 |
MHD_digest_auth_get_username (struct MHD_Connection *connection);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Free the memory given by @a ptr. Calls "free(ptr)". This function
|
|
Packit |
875988 |
* should be used to free the username returned by
|
|
Packit |
875988 |
* #MHD_digest_auth_get_username().
|
|
Packit |
875988 |
* @note Since v0.9.56
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param ptr pointer to free.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN void
|
|
Packit |
875988 |
MHD_free (void *ptr);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Authenticates the authorization header sent by the client
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection The MHD connection structure
|
|
Packit |
875988 |
* @param realm The realm presented to the client
|
|
Packit |
875988 |
* @param username The username needs to be authenticated
|
|
Packit |
875988 |
* @param password The password used in the authentication
|
|
Packit |
875988 |
* @param nonce_timeout The amount of time for a nonce to be
|
|
Packit |
875988 |
* invalid in seconds
|
|
Packit |
875988 |
* @return #MHD_YES if authenticated, #MHD_NO if not,
|
|
Packit |
875988 |
* #MHD_INVALID_NONCE if nonce is invalid
|
|
Packit |
875988 |
* @ingroup authentication
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_digest_auth_check (struct MHD_Connection *connection,
|
|
Packit |
875988 |
const char *realm,
|
|
Packit |
875988 |
const char *username,
|
|
Packit |
875988 |
const char *password,
|
|
Packit |
875988 |
unsigned int nonce_timeout);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Queues a response to request authentication from the client
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection The MHD connection structure
|
|
Packit |
875988 |
* @param realm The realm presented to the client
|
|
Packit |
875988 |
* @param opaque string to user for opaque value
|
|
Packit |
875988 |
* @param response reply to send; should contain the "access denied"
|
|
Packit |
875988 |
* body; note that this function will set the "WWW Authenticate"
|
|
Packit |
875988 |
* header and that the caller should not do this
|
|
Packit |
875988 |
* @param signal_stale #MHD_YES if the nonce is invalid to add
|
|
Packit |
875988 |
* 'stale=true' to the authentication header
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO otherwise
|
|
Packit |
875988 |
* @ingroup authentication
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_queue_auth_fail_response (struct MHD_Connection *connection,
|
|
Packit |
875988 |
const char *realm,
|
|
Packit |
875988 |
const char *opaque,
|
|
Packit |
875988 |
struct MHD_Response *response,
|
|
Packit |
875988 |
int signal_stale);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get the username and password from the basic authorization header sent by the client
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection The MHD connection structure
|
|
Packit |
875988 |
* @param[out] password a pointer for the password, free using #MHD_free().
|
|
Packit |
875988 |
* @return NULL if no username could be found, a pointer
|
|
Packit |
875988 |
* to the username if found, free using #MHD_free().
|
|
Packit |
875988 |
* @ingroup authentication
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN char *
|
|
Packit |
875988 |
MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
|
|
Packit |
875988 |
char** password);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Queues a response to request basic authentication from the client
|
|
Packit |
875988 |
* The given response object is expected to include the payload for
|
|
Packit |
875988 |
* the response; the "WWW-Authenticate" header will be added and the
|
|
Packit |
875988 |
* response queued with the 'UNAUTHORIZED' status code.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection The MHD connection structure
|
|
Packit |
875988 |
* @param realm the realm presented to the client
|
|
Packit |
875988 |
* @param response response object to modify and queue
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO otherwise
|
|
Packit |
875988 |
* @ingroup authentication
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection,
|
|
Packit |
875988 |
const char *realm,
|
|
Packit |
875988 |
struct MHD_Response *response);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* ********************** generic query functions ********************** */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain information about the given connection.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection what connection to get information about
|
|
Packit |
875988 |
* @param info_type what information is desired?
|
|
Packit |
875988 |
* @param ... depends on @a info_type
|
|
Packit |
875988 |
* @return NULL if this information is not available
|
|
Packit |
875988 |
* (or if the @a info_type is unknown)
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN const union MHD_ConnectionInfo *
|
|
Packit |
875988 |
MHD_get_connection_info (struct MHD_Connection *connection,
|
|
Packit |
875988 |
enum MHD_ConnectionInfoType info_type,
|
|
Packit |
875988 |
...);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* MHD connection options. Given to #MHD_set_connection_option to
|
|
Packit |
875988 |
* set custom options for a particular connection.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_CONNECTION_OPTION
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Set a custom timeout for the given connection. Specified
|
|
Packit |
875988 |
* as the number of seconds, given as an `unsigned int`. Use
|
|
Packit |
875988 |
* zero for no timeout.
|
|
Packit |
875988 |
* If timeout was set to zero (or unset) before, setup of new value by
|
|
Packit |
875988 |
* MHD_set_connection_option() will reset timeout timer.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_CONNECTION_OPTION_TIMEOUT
|
|
Packit |
875988 |
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Set a custom option for the given connection, overriding defaults.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param connection connection to modify
|
|
Packit |
875988 |
* @param option option to set
|
|
Packit |
875988 |
* @param ... arguments to the option, depending on the option type
|
|
Packit |
875988 |
* @return #MHD_YES on success, #MHD_NO if setting the option failed
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_set_connection_option (struct MHD_Connection *connection,
|
|
Packit |
875988 |
enum MHD_CONNECTION_OPTION option,
|
|
Packit |
875988 |
...);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Information about an MHD daemon.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
union MHD_DaemonInfo
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Size of the key, no longer supported.
|
|
Packit |
875988 |
* @deprecated
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
size_t key_size;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Size of the mac key, no longer supported.
|
|
Packit |
875988 |
* @deprecated
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
size_t mac_key_size;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Socket, returned for #MHD_DAEMON_INFO_LISTEN_FD.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_socket listen_fd;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Bind port number, returned for #MHD_DAEMON_INFO_BIND_PORT.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
uint16_t port;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* epoll FD, returned for #MHD_DAEMON_INFO_EPOLL_FD.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
int epoll_fd;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Number of active connections, for #MHD_DAEMON_INFO_CURRENT_CONNECTIONS.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
unsigned int num_connections;
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Combination of #MHD_FLAG values, for #MHD_DAEMON_INFO_FLAGS.
|
|
Packit |
875988 |
* This value is actually a bitfield.
|
|
Packit |
875988 |
* Note: flags may differ from original 'flags' specified for
|
|
Packit |
875988 |
* daemon, especially if #MHD_USE_AUTO was set.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_FLAG flags;
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain information about the given daemon
|
|
Packit |
875988 |
* (not fully implemented!).
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param daemon what daemon to get information about
|
|
Packit |
875988 |
* @param info_type what information is desired?
|
|
Packit |
875988 |
* @param ... depends on @a info_type
|
|
Packit |
875988 |
* @return NULL if this information is not available
|
|
Packit |
875988 |
* (or if the @a info_type is unknown)
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN const union MHD_DaemonInfo *
|
|
Packit |
875988 |
MHD_get_daemon_info (struct MHD_Daemon *daemon,
|
|
Packit |
875988 |
enum MHD_DaemonInfoType info_type,
|
|
Packit |
875988 |
...);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Obtain the version of this library
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @return static version string, e.g. "0.9.9"
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN const char*
|
|
Packit |
875988 |
MHD_get_version (void);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Types of information about MHD features,
|
|
Packit |
875988 |
* used by #MHD_is_feature_supported().
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
enum MHD_FEATURE
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether messages are supported. If supported then in debug
|
|
Packit |
875988 |
* mode messages can be printed to stderr or to external logger.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_MESSAGES = 1,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether HTTPS is supported. If supported then flag
|
|
Packit |
875988 |
* #MHD_USE_TLS and options #MHD_OPTION_HTTPS_MEM_KEY,
|
|
Packit |
875988 |
* #MHD_OPTION_HTTPS_MEM_CERT, #MHD_OPTION_HTTPS_MEM_TRUST,
|
|
Packit |
875988 |
* #MHD_OPTION_HTTPS_MEM_DHPARAMS, #MHD_OPTION_HTTPS_CRED_TYPE,
|
|
Packit |
875988 |
* #MHD_OPTION_HTTPS_PRIORITIES can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_TLS = 2,
|
|
Packit |
875988 |
MHD_FEATURE_SSL = 2,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK is
|
|
Packit |
875988 |
* supported.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_HTTPS_CERT_CALLBACK = 3,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether IPv6 is supported. If supported then flag
|
|
Packit |
875988 |
* #MHD_USE_IPv6 can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_IPv6 = 4,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether IPv6 without IPv4 is supported. If not supported
|
|
Packit |
875988 |
* then IPv4 is always enabled in IPv6 sockets and
|
|
Packit |
875988 |
* flag #MHD_USE_DUAL_STACK if always used when #MHD_USE_IPv6 is
|
|
Packit |
875988 |
* specified.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_IPv6_ONLY = 5,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether `poll()` is supported. If supported then flag
|
|
Packit |
875988 |
* #MHD_USE_POLL can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_POLL = 6,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether `epoll()` is supported. If supported then Flags
|
|
Packit |
875988 |
* #MHD_USE_EPOLL and
|
|
Packit |
875988 |
* #MHD_USE_EPOLL_INTERNAL_THREAD can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_EPOLL = 7,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether shutdown on listen socket to signal other
|
|
Packit |
875988 |
* threads is supported. If not supported flag
|
|
Packit |
875988 |
* #MHD_USE_ITC is automatically forced.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET = 8,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether socketpair is used internally instead of pipe to
|
|
Packit |
875988 |
* signal other threads.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_SOCKETPAIR = 9,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether TCP Fast Open is supported. If supported then
|
|
Packit |
875988 |
* flag #MHD_USE_TCP_FASTOPEN and option
|
|
Packit |
875988 |
* #MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_TCP_FASTOPEN = 10,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether HTTP Basic authorization is supported. If supported
|
|
Packit |
875988 |
* then functions #MHD_basic_auth_get_username_password and
|
|
Packit |
875988 |
* #MHD_queue_basic_auth_fail_response can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_BASIC_AUTH = 11,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether HTTP Digest authorization is supported. If
|
|
Packit |
875988 |
* supported then options #MHD_OPTION_DIGEST_AUTH_RANDOM,
|
|
Packit |
875988 |
* #MHD_OPTION_NONCE_NC_SIZE and
|
|
Packit |
875988 |
* #MHD_digest_auth_check() can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_DIGEST_AUTH = 12,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether postprocessor is supported. If supported then
|
|
Packit |
875988 |
* functions #MHD_create_post_processor(), #MHD_post_process() and
|
|
Packit |
875988 |
* #MHD_destroy_post_processor() can
|
|
Packit |
875988 |
* be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_POSTPROCESSOR = 13,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether password encrypted private key for HTTPS daemon is
|
|
Packit |
875988 |
* supported. If supported then option
|
|
Packit |
875988 |
* ::MHD_OPTION_HTTPS_KEY_PASSWORD can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_HTTPS_KEY_PASSWORD = 14,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether reading files beyond 2 GiB boundary is supported.
|
|
Packit |
875988 |
* If supported then #MHD_create_response_from_fd(),
|
|
Packit |
875988 |
* #MHD_create_response_from_fd64 #MHD_create_response_from_fd_at_offset()
|
|
Packit |
875988 |
* and #MHD_create_response_from_fd_at_offset64() can be used with sizes and
|
|
Packit |
875988 |
* offsets larger than 2 GiB. If not supported value of size+offset is
|
|
Packit |
875988 |
* limited to 2 GiB.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_LARGE_FILE = 15,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether MHD set names on generated threads.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_THREAD_NAMES = 16,
|
|
Packit |
875988 |
MHD_THREAD_NAMES = 16,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether HTTP "Upgrade" is supported.
|
|
Packit |
875988 |
* If supported then #MHD_ALLOW_UPGRADE, #MHD_upgrade_action() and
|
|
Packit |
875988 |
* #MHD_create_response_for_upgrade() can be used.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_UPGRADE = 17,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether it's safe to use same FD for multiple calls of
|
|
Packit |
875988 |
* #MHD_create_response_from_fd() and whether it's safe to use single
|
|
Packit |
875988 |
* response generated by #MHD_create_response_from_fd() with multiple
|
|
Packit |
875988 |
* connections at same time.
|
|
Packit |
875988 |
* If #MHD_is_feature_supported() return #MHD_NO for this feature then
|
|
Packit |
875988 |
* usage of responses with same file FD in multiple parallel threads may
|
|
Packit |
875988 |
* results in incorrect data sent to remote client.
|
|
Packit |
875988 |
* It's always safe to use same file FD in multiple responses if MHD
|
|
Packit |
875988 |
* is run in any single thread mode.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_RESPONSES_SHARED_FD = 18,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether MHD support automatic detection of bind port number.
|
|
Packit |
875988 |
* @sa #MHD_DAEMON_INFO_BIND_PORT
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_AUTODETECT_BIND_PORT = 19,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether MHD support SIGPIPE suppression.
|
|
Packit |
875988 |
* If SIGPIPE suppression is not supported, application must handle
|
|
Packit |
875988 |
* SIGPIPE signal by itself.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_AUTOSUPPRESS_SIGPIPE = 20,
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get whether MHD use system's sendfile() function to send
|
|
Packit |
875988 |
* file-FD based responses over non-TLS connections.
|
|
Packit |
875988 |
* @note Since v0.9.56
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
MHD_FEATURE_SENDFILE = 21
|
|
Packit |
875988 |
};
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Get information about supported MHD features.
|
|
Packit |
875988 |
* Indicate that MHD was compiled with or without support for
|
|
Packit |
875988 |
* particular feature. Some features require additional support
|
|
Packit |
875988 |
* by kernel. Kernel support is not checked by this function.
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* @param feature type of requested information
|
|
Packit |
875988 |
* @return #MHD_YES if feature is supported by MHD, #MHD_NO if
|
|
Packit |
875988 |
* feature is not supported or feature is unknown.
|
|
Packit |
875988 |
* @ingroup specialized
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
_MHD_EXTERN int
|
|
Packit |
875988 |
MHD_is_feature_supported (enum MHD_FEATURE feature);
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if 0 /* keep Emacsens' auto-indent happy */
|
|
Packit |
875988 |
{
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
#ifdef __cplusplus
|
|
Packit |
875988 |
}
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#endif
|