From ef838c8a0c7a6f001452aff3274ab1fc2908386a Mon Sep 17 00:00:00 2001 From: hexian000 Date: Sun, 24 Sep 2023 12:11:27 +0800 Subject: [PATCH] server: set listener backlog properly Signed-off-by: hexian000 --- src/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index 9f469ab..4039821 100644 --- a/src/server.c +++ b/src/server.c @@ -140,7 +140,7 @@ bool server_start(struct server *s, const struct sockaddr *bindaddr) #endif #if WITH_TCP_FASTOPEN if (conf->tcp_fastopen) { - socket_set_fastopen(fd, 256); + socket_set_fastopen(fd, conf->startup_limit_full); } #endif socket_set_tcp(fd, conf->tcp_nodelay, conf->tcp_keepalive); @@ -151,7 +151,7 @@ bool server_start(struct server *s, const struct sockaddr *bindaddr) CLOSE_FD(fd); return false; } - if (listen(fd, 16)) { + if (listen(fd, conf->startup_limit_full)) { const int err = errno; LOGE_F("listen error: %s", strerror(err)); CLOSE_FD(fd);