aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-13 14:51:05 +0200
committerKim Alvefur <zash@zash.se>2021-07-13 14:51:05 +0200
commit123a7b70799c0ec3f773a7422e304ca4940b3ae3 (patch)
tree0e22025918d0505e2acd2696b815eca1dcc8a924
parent063a7e45a32661ca192d4aa0d7321f998b240a15 (diff)
downloadprosody-123a7b70799c0ec3f773a7422e304ca4940b3ae3.tar.gz
prosody-123a7b70799c0ec3f773a7422e304ca4940b3ae3.zip
net.server_epoll: Keep socket registered in epoll trough TLS wrapping
There's the theory that the socket isn't the same before/after wrap(), but since epoll operates on FD numbers this shouldn't matter.
-rw-r--r--net/server_epoll.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index b89f6cb8..ce69abb1 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -575,7 +575,6 @@ function interface:inittls(tls_ctx)
if tls_ctx then self.tls_ctx = tls_ctx; end
self._tls = true;
self:debug("Starting TLS now");
- self:del();
self:updatenames(); -- Can't getpeer/sockname after wrap()
local ok, conn, err = pcall(luasec.wrap, self.conn, self.tls_ctx);
if not ok then
@@ -615,7 +614,7 @@ function interface:inittls(tls_ctx)
self.onreadable = interface.tlshandshake;
self:setreadtimeout(cfg.ssl_handshake_timeout);
self:setwritetimeout(cfg.ssl_handshake_timeout);
- self:add(true, true);
+ self:set(true, true);
end
function interface:tlshandshake()