aboutsummaryrefslogtreecommitdiff
path: root/src/include/microhttpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r--src/include/microhttpd.h74
1 files changed, 63 insertions, 11 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index b66f4b3d..93967c60 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -96,7 +96,7 @@ extern "C"
96 * they are parsed as decimal numbers. 96 * they are parsed as decimal numbers.
97 * Example: 0x01093001 = 1.9.30-1. 97 * Example: 0x01093001 = 1.9.30-1.
98 */ 98 */
99#define MHD_VERSION 0x00097544 99#define MHD_VERSION 0x00097545
100 100
101/* If generic headers don't work on your platform, include headers 101/* If generic headers don't work on your platform, include headers
102 which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', 102 which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t',
@@ -1291,12 +1291,14 @@ enum MHD_FLAG
1291 * as liberal as possible in what you accept" norm. It is 1291 * as liberal as possible in what you accept" norm. It is
1292 * recommended to turn this ON if you are testing clients against 1292 * recommended to turn this ON if you are testing clients against
1293 * MHD, and OFF in production. 1293 * MHD, and OFF in production.
1294 * @sa #MHD_OPTION_CLIENT_DISCIPLINE_LVL
1294 */ 1295 */
1295 MHD_USE_PEDANTIC_CHECKS = 32, 1296 MHD_USE_PEDANTIC_CHECKS = 32,
1296#if 0 /* Will be marked for real deprecation later. */ 1297#if 0 /* Will be marked for real deprecation later. */
1297#define MHD_USE_PEDANTIC_CHECKS \ 1298#define MHD_USE_PEDANTIC_CHECKS \
1298 _MHD_DEPR_IN_MACRO ( \ 1299 _MHD_DEPR_IN_MACRO ( \
1299 "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \ 1300 "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, " \
1301 "use option MHD_OPTION_CLIENT_DISCIPLINE_LVL instead") \
1300 32 1302 32
1301#endif /* 0 */ 1303#endif /* 0 */
1302 1304
@@ -1939,15 +1941,18 @@ enum MHD_OPTION
1939 * If set to 1 - be strict about the protocol. Use -1 to be 1941 * If set to 1 - be strict about the protocol. Use -1 to be
1940 * as tolerant as possible. 1942 * as tolerant as possible.
1941 * 1943 *
1942 * Specifically, at the moment, at 1 this flag 1944 * The more flexible option #MHD_OPTION_CLIENT_DISCIPLINE_LVL is recommended
1943 * causes MHD to reject HTTP 1.1 connections without a "Host" header, 1945 * instead of this option.
1944 * and to disallow spaces in the URL or (at -1) in HTTP header key strings.
1945 * 1946 *
1946 * These are required by some versions of the standard, but of 1947 * The values mapping table:
1947 * course in violation of the "be as liberal as possible in what you 1948 * #MHD_OPTION_STRICT_FOR_CLIENT | #MHD_OPTION_CLIENT_DISCIPLINE_LVL
1948 * accept" norm. It is recommended to set this to 1 if you are 1949 * -----------------------------:|:---------------------------------
1949 * testing clients against MHD, and 0 in production. This option 1950 * 1 | 1
1950 * should be followed by an `int` argument. 1951 * 0 | 0
1952 * -1 | -3
1953 *
1954 * This option should be followed by an `int` argument.
1955 * @sa #MHD_OPTION_CLIENT_DISCIPLINE_LVL
1951 */ 1956 */
1952 MHD_OPTION_STRICT_FOR_CLIENT = 29, 1957 MHD_OPTION_STRICT_FOR_CLIENT = 29,
1953 1958
@@ -2037,7 +2042,54 @@ enum MHD_OPTION
2037 * default priorities. 2042 * default priorities.
2038 * @note Available since #MHD_VERSION 0x00097542 2043 * @note Available since #MHD_VERSION 0x00097542
2039 */ 2044 */
2040 MHD_OPTION_HTTPS_PRIORITIES_APPEND = 37 2045 MHD_OPTION_HTTPS_PRIORITIES_APPEND = 37,
2046
2047 /**
2048 * Sets specified client discipline level (i.e. HTTP protocol parsing
2049 * strictness level).
2050 *
2051 * The following basic values are supported:
2052 * 0 - default MHD level, a balance between extra security and broader
2053 * compatibility, as allowed by RFCs for HTTP servers;
2054 * 1 - more strict protocol interpretation, within the limits set by
2055 * RFCs for HTTP servers;
2056 * -1 - more lenient protocol interpretation, within the limits set by
2057 * RFCs for HTTP servers.
2058 * The following extended values could be used as well:
2059 * 2 - stricter protocol interpretation, even stricter then allowed
2060 * by RFCs for HTTP servers, however it should be absolutely compatible
2061 * with clients following at least RFCs' "MUST" type of requirements
2062 * for HTTP clients;
2063 * 3 - strictest protocol interpretation, even stricter then allowed
2064 * by RFCs for HTTP servers, however it should be absolutely compatible
2065 * with clients following RFCs' "SHOULD" and "MUST" types of requirements
2066 * for HTTP clients;
2067 * -2 - more relaxed protocol interpretation, violating RFCs' "SHOULD" type
2068 * of requirements for HTTP servers;
2069 * -3 - the most flexible protocol interpretation, beyond RFCs' "MUST" type of
2070 * requirements for HTTP server.
2071 * Values higher than "3" or lower than "-3" are interpreted as "3" or "-3"
2072 * respectively.
2073 *
2074 * Higher values are more secure, lower values are more compatible with
2075 * various HTTP clients.
2076 *
2077 * The default value ("0") could be used in most cases.
2078 * Value "1" is suitable for highly loaded public servers.
2079 * Values "2" and "3" are generally recommended only for testing of HTTP
2080 * clients against MHD.
2081 * Value "2" may be used for security-centric application, however it is
2082 * slight violation of RFCs' requirements.
2083 * Negative values are not recommended for public servers.
2084 * Values "-1" and "-2" could be used for servers in isolated environment.
2085 * Value "-3" is not recommended unless it is absolutely necessary to
2086 * communicate with some client(s) with badly broken HTTP implementation.
2087 *
2088 * This option should be followed by an `int` argument.
2089 * @note Available since #MHD_VERSION 0x00097545
2090 */
2091 MHD_OPTION_CLIENT_DISCIPLINE_LVL = 38
2092
2041} _MHD_FIXED_ENUM; 2093} _MHD_FIXED_ENUM;
2042 2094
2043 2095