From db9cb051c4ee05c07ab32dfed5bae8b7dc0916bd Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 6 Oct 2025 21:03:59 +0200 Subject: Allow custom backlog connections libweb calls listen(2) when setting up the HTTP server, and its backlog argument was hardcoded to 10. While probably not an issue for some applications, it can be too limiting for some others. Therefore, it is desirable to allow library users to set up their own limits. Otherwise, 10 is still chosen as a sane default. --- doc/man7/libweb_handler.7 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/man7/libweb_handler.7 b/doc/man7/libweb_handler.7 index 4b0c454..5398675 100644 --- a/doc/man7/libweb_handler.7 +++ b/doc/man7/libweb_handler.7 @@ -77,6 +77,7 @@ struct handler_cfg void *\fIuser\fP; size_t \fImax_headers\fP; struct http_cfg_post \fIpost\fP; + unsigned \fIbacklog\fP; }; .EE .in @@ -96,6 +97,19 @@ object. See .IR libweb_http (7) for further reference about these members. +On the other hand, +.I backlog +is passed directly to the call to +.IR listen (2) +done internally by +.IR libweb , +and must not exceed +.IR INT_MAX . +If +.I backlog +equals zero, +it shall default to 10. + However, a .I "struct handler" object as returned by @@ -235,7 +249,8 @@ end: .BR handler_free (3), .BR handler_listen (3), .BR handler_loop (3), -.BR libweb_http (7). +.BR libweb_http (7), +.BR listen (2). .SH COPYRIGHT Copyright (C) 2023-2024 libweb contributors -- cgit v1.2.3