aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-12 13:25:08 +0100
committerKim Alvefur <zash@zash.se>2021-01-12 13:25:08 +0100
commitf36531b53a33601d2ccf9b3481f20c26efc0198b (patch)
treea756b97a22d4fab8ca3a67a05cfc2c0850ad2343
parent5cf3eea2454a1763bd741a89dfebab192c94c812 (diff)
downloadprosody-f36531b53a33601d2ccf9b3481f20c26efc0198b.tar.gz
prosody-f36531b53a33601d2ccf9b3481f20c26efc0198b.zip
net.adns: Prevent empty packets from being sent on "connect" (fix #1619)
Thanks Ge0rG for testing
-rw-r--r--net/adns.lua5
1 files changed, 5 insertions, 0 deletions
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