From 5cf3eea2454a1763bd741a89dfebab192c94c812 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 10 Jan 2021 14:54:03 +0100 Subject: net.server_epoll: Fix off-by-one in 2c559953ad41 Thanks tmolitor --- net/server_epoll.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/server_epoll.lua b/net/server_epoll.lua index e2be448c..53a67dd5 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -123,7 +123,7 @@ local function runtimers(next_delay, min_wait) if readd then for _, timer in pairs(readd) do - timers:insert(timer, timer[2]); + timers:insert(timer, timer[1]); end peek = timers:peek(); end -- cgit v1.2.3 From f36531b53a33601d2ccf9b3481f20c26efc0198b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 12 Jan 2021 13:25:08 +0100 Subject: net.adns: Prevent empty packets from being sent on "connect" (fix #1619) Thanks Ge0rG for testing --- net/adns.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net') diff --git a/net/adns.lua b/net/adns.lua index 560e4b53..0bdf6ee3 100644 --- a/net/adns.lua +++ b/net/adns.lua @@ -50,6 +50,11 @@ local function new_async_socket(sock, resolver) if not handler then return nil, err; end + if handler.set then + -- server_epoll: only watch for incoming data + -- avoids sending empty packet on first 'onwritable' event + handler:set(true, false); + end handler.settimeout = function () end handler.setsockname = function (_, ...) return sock:setsockname(...); end -- cgit v1.2.3