From ff870e7fa77ee26ad445bdbbf007b50126dc91da Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 1 May 2025 12:06:15 -0400 Subject: [PATCH] tiny_httpd: limit max pool size to 4096 --- src/tiny_httpd/nanoev_tiny_httpd.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tiny_httpd/nanoev_tiny_httpd.ml b/src/tiny_httpd/nanoev_tiny_httpd.ml index 71ebb65..290b0ad 100644 --- a/src/tiny_httpd/nanoev_tiny_httpd.ml +++ b/src/tiny_httpd/nanoev_tiny_httpd.ml @@ -294,7 +294,7 @@ let create ?(masksigpipe = not Sys.win32) ?max_connections ?(timeout = 0.0) ?buf_size ?(get_time_s = Unix.gettimeofday) ?(addr = "127.0.0.1") ?(port = 8080) ?sock ?middlewares ~new_thread () : TH.Server.t = let max_connections = get_max_connection_ ?max_connections () in - let max_pool_size = max_connections * 2 in + let max_pool_size = min 4096 max_connections * 2 in let server = { Unix_tcp_server_.addr;