net/server_epoll.lua
changeset 11693 f9f6e82fb572
parent 11692 3fc564f7441b
child 11698 d6be4dda1f60
--- a/net/server_epoll.lua	Wed Jul 14 22:13:30 2021 +0200
+++ b/net/server_epoll.lua	Wed Jul 14 22:27:12 2021 +0200
@@ -83,6 +83,9 @@
 
 	-- TCP Keepalives
 	tcp_keepalive = false; -- boolean | number
+
+	-- Whether to let the Nagle algorithm stay enabled
+	nagle = true;
 }};
 local cfg = default_config.__index;
 
@@ -731,6 +734,9 @@
 end
 
 function interface:defaultoptions()
+	if cfg.nagle == false then
+		self:setoption("tcp-nodelay", true);
+	end
 	if cfg.tcp_keepalive then
 		self:setoption("keepalive", true);
 		if type(cfg.tcp_keepalive) == "number" then