aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/internal.h
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-11-07 12:47:08 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-11-07 20:49:10 +0300
commit89c1076aac6e187028ba2f27a43ae1f4393e0e5a (patch)
treec7aa0414c37995b353116ce81a6981120a8057bf /src/microhttpd/internal.h
parenta1954f60983daebf89947a08bd46471d6b7a9587 (diff)
downloadlibmicrohttpd-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/microhttpd/internal.h')
-rw-r--r--src/microhttpd/internal.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 0f8669f4..eb87c8e6 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -2264,6 +2264,22 @@ struct MHD_Daemon
2264 */ 2264 */
2265 int client_discipline; 2265 int client_discipline;
2266 2266
2267#ifdef HAS_FD_SETSIZE_OVERRIDABLE
2268 /**
2269 * The value of FD_SETSIZE used by the daemon.
2270 * For external sockets polling this is the value provided by the application
2271 * via MHD_OPTION_APP_FD_SETSIZE or current FD_SETSIZE value.
2272 * For internal threads modes this is always current FD_SETSIZE value.
2273 */
2274 int fdset_size;
2275
2276 /**
2277 * Indicates whether @a fdset_size value was set by application.
2278 * 'false' if default value is used.
2279 */
2280 bool fdset_size_set_by_app;
2281#endif /* HAS_FD_SETSIZE_OVERRIDABLE */
2282
2267 /** 2283 /**
2268 * True if SIGPIPE is blocked 2284 * True if SIGPIPE is blocked
2269 */ 2285 */
@@ -2555,6 +2571,24 @@ struct MHD_Daemon
2555#define MHD_D_IS_USING_THREAD_PER_CONN_(d) ((void) d, 0) 2571#define MHD_D_IS_USING_THREAD_PER_CONN_(d) ((void) d, 0)
2556#endif /* ! MHD_USE_THREADS */ 2572#endif /* ! MHD_USE_THREADS */
2557 2573
2574#ifdef HAS_FD_SETSIZE_OVERRIDABLE
2575/**
2576 * Get FD_SETSIZE used by the daemon @a d
2577 */
2578#define MHD_D_GET_FD_SETSIZE_(d) ((d)->fdset_size)
2579#else /* ! HAS_FD_SETSIZE_OVERRIDABLE */
2580/**
2581 * Get FD_SETSIZE used by the daemon @a d
2582 */
2583#define MHD_D_GET_FD_SETSIZE_(d) (FD_SETSIZE)
2584#endif /* ! HAS_FD_SETSIZE_OVERRIDABLE */
2585
2586/**
2587 * Check whether socket @a sckt fits fd_sets used by the daemon @a d
2588 */
2589#define MHD_D_DOES_SCKT_FIT_FDSET_(sckt,pset,d) \
2590 MHD_SCKT_FD_FITS_FDSET_SETSIZE_(sckt,pset,MHD_D_GET_FD_SETSIZE_(d))
2591
2558 2592
2559#ifdef DAUTH_SUPPORT 2593#ifdef DAUTH_SUPPORT
2560 2594