net.server_epoll: Keep socket registered in epoll trough TLS wrapping
authorKim Alvefur <zash@zash.se>
Tue, 13 Jul 2021 14:51:05 +0200
changeset 11679 139d80774f11
parent 11678 8253f6a30afc
child 11680 993462e5e4d4
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.
net/server_epoll.lua
--- a/net/server_epoll.lua	Tue Jul 13 14:27:46 2021 +0200
+++ b/net/server_epoll.lua	Tue Jul 13 14:51:05 2021 +0200
@@ -575,7 +575,6 @@
 	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 @@
 	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()