aboutsummaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-10-06 21:03:59 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2025-10-06 21:03:59 +0200
commitdb9cb051c4ee05c07ab32dfed5bae8b7dc0916bd (patch)
tree44e1efae86af612923ec5486c00eb2c56019c865 /handler.c
parent4918cf87d3cf5d3dd8425fe10d97a06282472df6 (diff)
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.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/handler.c b/handler.c
index 98e6118..63ef726 100644
--- a/handler.c
+++ b/handler.c
@@ -220,7 +220,7 @@ int handler_notify_close(struct handler *const h)
int handler_listen(struct handler *const h, const unsigned short port,
unsigned short *const outport)
{
- if (!(h->server = server_init(port, outport)))
+ if (!(h->server = server_init(port, outport, h->cfg.backlog)))
{
fprintf(stderr, "%s: server_init failed\n", __func__);
return -1;