diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-15 15:33:33 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-16 09:08:40 +0300 |
commit | f5a72d27f36cdcd9958298e77aa85c2d7ee1d714 (patch) | |
tree | acd0215726538a8be81869d215e9a11035ec2243 /src/include/microhttpd.h | |
parent | f73ab438317568b24cf005ae38cf36e01920d74d (diff) | |
download | libmicrohttpd-f5a72d27f36cdcd9958298e77aa85c2d7ee1d714.tar.gz libmicrohttpd-f5a72d27f36cdcd9958298e77aa85c2d7ee1d714.zip |
Implemented new option MHD_OPTION_SOCK_ADDR_LEN
Improved detection of TCP/IP port in application-provided sockaddr.
Added automatic detection of used address facility (sockets type).
Improved support of platforms with sa_len, ss_len, sin_len and sin6_len.
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r-- | src/include/microhttpd.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 6026e803..e1d12645 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 0x00097705 | 99 | #define MHD_VERSION 0x00097706 |
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', |
@@ -1704,6 +1704,8 @@ enum MHD_OPTION | |||
1704 | * be followed by a `struct sockaddr *`. If #MHD_USE_IPv6 is | 1704 | * be followed by a `struct sockaddr *`. If #MHD_USE_IPv6 is |
1705 | * specified, the `struct sockaddr*` should point to a `struct | 1705 | * specified, the `struct sockaddr*` should point to a `struct |
1706 | * sockaddr_in6`, otherwise to a `struct sockaddr_in`. | 1706 | * sockaddr_in6`, otherwise to a `struct sockaddr_in`. |
1707 | * Silently ignored if followed by NULL pointer. | ||
1708 | * @deprecated Use #MHD_OPTION_SOCK_ADDR_LEN | ||
1707 | */ | 1709 | */ |
1708 | MHD_OPTION_SOCK_ADDR = 6, | 1710 | MHD_OPTION_SOCK_ADDR = 6, |
1709 | 1711 | ||
@@ -2142,7 +2144,23 @@ enum MHD_OPTION | |||
2142 | * This option should be followed by a positive 'int' argument. | 2144 | * This option should be followed by a positive 'int' argument. |
2143 | * @note Available since #MHD_VERSION 0x00097705 | 2145 | * @note Available since #MHD_VERSION 0x00097705 |
2144 | */ | 2146 | */ |
2145 | MHD_OPTION_APP_FD_SETSIZE = 39 | 2147 | MHD_OPTION_APP_FD_SETSIZE = 39, |
2148 | |||
2149 | /** | ||
2150 | * Bind daemon to the supplied 'struct sockaddr'. This option should | ||
2151 | * be followed by two parameters: 'socklen_t' the size of memory at the next | ||
2152 | * pointer and the pointer 'const struct sockaddr *'. | ||
2153 | * Note: the order of the arguments is not the same as for system bind() and | ||
2154 | * other network functions. | ||
2155 | * If #MHD_USE_IPv6 is specified, the 'struct sockaddr*' should | ||
2156 | * point to a 'struct sockaddr_in6'. | ||
2157 | * The socket domain (protocol family) is detected from provided | ||
2158 | * 'struct sockaddr'. IP, IPv6 and UNIX sockets are supported (if supported | ||
2159 | * by the platform). Other types may work occasionally. | ||
2160 | * Silently ignored if followed by zero size and NULL pointer. | ||
2161 | * @note Available since #MHD_VERSION 0x00097706 | ||
2162 | */ | ||
2163 | MHD_OPTION_SOCK_ADDR_LEN = 40 | ||
2146 | 2164 | ||
2147 | } _MHD_FIXED_ENUM; | 2165 | } _MHD_FIXED_ENUM; |
2148 | 2166 | ||