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.
This commit is contained in:
Kim Alvefur 2021-07-13 14:51:05 +02:00
parent 063a7e45a3
commit 123a7b7079

View file

@ -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()