Changeset

11675:139d80774f11

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.
author Kim Alvefur <zash@zash.se>
date Tue, 13 Jul 2021 14:51:05 +0200
parents 11674:8253f6a30afc
children 11676:993462e5e4d4
files net/server_epoll.lua
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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()