libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 5f8e3c9b93d13553a4e0d9df406091888a05dc7c
parent 6e98d63538a3c15fb4fbd92955c56ad82dee9ac5
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Wed,  1 Nov 2023 13:35:49 +0300

Adjusted default value of maximum connections

Diffstat:
Msrc/microhttpd/daemon.c | 2+-
Msrc/microhttpd/mhd_itc.h | 14++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -77,7 +77,7 @@ * Default connection limit. */ #ifdef MHD_POSIX_SOCKETS -#define MHD_MAX_CONNECTIONS_DEFAULT (FD_SETSIZE - 4) +#define MHD_MAX_CONNECTIONS_DEFAULT (FD_SETSIZE - 3 - 1 - MHD_ITC_NUM_FDS_) #else #define MHD_MAX_CONNECTIONS_DEFAULT (FD_SETSIZE - 2) #endif diff --git a/src/microhttpd/mhd_itc.h b/src/microhttpd/mhd_itc.h @@ -61,6 +61,10 @@ #include <errno.h> #endif +/** + * Number of FDs used by every ITC. + */ +#define MHD_ITC_NUM_FDS_ (1) /** * Initialise ITC by generating eventFD @@ -156,6 +160,11 @@ static const uint64_t _MHD_itc_wr_data = 1; /** + * Number of FDs used by every ITC. + */ +#define MHD_ITC_NUM_FDS_ (2) + +/** * Initialise ITC by generating pipe * @param itc the itc to initialise * @return non-zero if succeeded, zero otherwise @@ -257,6 +266,11 @@ MHD_itc_nonblocking_ (struct MHD_itc_ itc); /** + * Number of FDs used by every ITC. + */ +#define MHD_ITC_NUM_FDS_ (2) + +/** * Initialise ITC by generating socketpair * @param itc the itc to initialise * @return non-zero if succeeded, zero otherwise