From 9ced2f614d0815d1ffa63fcc840fcc11c80c8aa3 Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 12 Mar 2026 19:16:42 -0400 Subject: [PATCH] Fix #2395 --- httplib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/httplib.h b/httplib.h index a2e4750..c3b21cd 100644 --- a/httplib.h +++ b/httplib.h @@ -11319,6 +11319,10 @@ inline bool Server::listen_internal() { detail::set_socket_opt_time(sock, SOL_SOCKET, SO_SNDTIMEO, write_timeout_sec_, write_timeout_usec_); + if (tcp_nodelay_) { + detail::set_socket_opt(sock, IPPROTO_TCP, TCP_NODELAY, 1); + } + if (!task_queue->enqueue( [this, sock]() { process_and_close_socket(sock); })) { output_error_log(Error::ResourceExhaustion, nullptr);