diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-07 12:47:08 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-07 20:49:10 +0300 |
commit | 89c1076aac6e187028ba2f27a43ae1f4393e0e5a (patch) | |
tree | c7aa0414c37995b353116ce81a6981120a8057bf /src/include/microhttpd.h | |
parent | a1954f60983daebf89947a08bd46471d6b7a9587 (diff) | |
download | libmicrohttpd-89c1076aac6e187028ba2f27a43ae1f4393e0e5a.tar.gz libmicrohttpd-89c1076aac6e187028ba2f27a43ae1f4393e0e5a.zip |
Added MHD_OPTION_APP_FD_SETSIZE and MHD_FEATURE_FLEXIBLE_FD_SETSIZE
This should provide better compatibility with platforms with ability
to override FD_SETSIZE.
The new option is used examples and tests.
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r-- | src/include/microhttpd.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 9fda5b6c..221d24fc 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 0x00097704 | 99 | #define MHD_VERSION 0x00097705 |
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', |
@@ -2118,7 +2118,29 @@ enum MHD_OPTION | |||
2118 | * This option should be followed by an `int` argument. | 2118 | * This option should be followed by an `int` argument. |
2119 | * @note Available since #MHD_VERSION 0x00097701 | 2119 | * @note Available since #MHD_VERSION 0x00097701 |
2120 | */ | 2120 | */ |
2121 | MHD_OPTION_CLIENT_DISCIPLINE_LVL = 38 | 2121 | MHD_OPTION_CLIENT_DISCIPLINE_LVL = 38, |
2122 | |||
2123 | /** | ||
2124 | * Specifies value of FD_SETSIZE used by application. Only For external | ||
2125 | * polling modes (without MHD internal threads). | ||
2126 | * Some platforms (FreeBSD, Solaris, W32 etc.) allow overriding of FD_SETSIZE | ||
2127 | * value. When polling by select() is used, MHD rejects sockets with numbers | ||
2128 | * equal or higher than FD_SETSIZE. If this option is used, MHD treats this | ||
2129 | * value as a limitation for socket number instead of FD_SETSIZE value which | ||
2130 | * was used for building MHD. | ||
2131 | * When external polling is used with #MHD_get_fdset2() (or #MHD_get_fdset() | ||
2132 | * macro) and #MHD_run_from_select() interfaces, it is recommended to always | ||
2133 | * use this option. | ||
2134 | * It is safe to use this option on platforms with fixed FD_SETSIZE (like | ||
2135 | * GNU/Linux) if system value of FD_SETSIZE is used as the argument. | ||
2136 | * Can be used only for daemons without #MHD_USE_INTERNAL_POLLING_THREAD, i.e. | ||
2137 | * only when external sockets polling is used. | ||
2138 | * On W32 it is silently ignored, as W32 does not limit the socket number in | ||
2139 | * fd_sets. | ||
2140 | * This option should be followed by a positive 'int' argument. | ||
2141 | * @note Available since #MHD_VERSION 0x00097705 | ||
2142 | */ | ||
2143 | MHD_OPTION_APP_FD_SETSIZE = 39 | ||
2122 | 2144 | ||
2123 | } _MHD_FIXED_ENUM; | 2145 | } _MHD_FIXED_ENUM; |
2124 | 2146 | ||
@@ -6339,7 +6361,16 @@ enum MHD_FEATURE | |||
6339 | * is not specified for daemon. | 6361 | * is not specified for daemon. |
6340 | * @note Available since #MHD_VERSION 0x00097701 | 6362 | * @note Available since #MHD_VERSION 0x00097701 |
6341 | */ | 6363 | */ |
6342 | MHD_FEATURE_DEBUG_BUILD = 33 | 6364 | MHD_FEATURE_DEBUG_BUILD = 33, |
6365 | |||
6366 | /** | ||
6367 | * Get whether MHD was build with support for overridable FD_SETSIZE. | ||
6368 | * This feature should be always available when the relevant platform ability | ||
6369 | * is detected. | ||
6370 | * @sa #MHD_OPTION_APP_FD_SETSIZE | ||
6371 | * @note Available since #MHD_VERSION 0x00097705 | ||
6372 | */ | ||
6373 | MHD_FEATURE_FLEXIBLE_FD_SETSIZE = 34 | ||
6343 | }; | 6374 | }; |
6344 | 6375 | ||
6345 | 6376 | ||