From 357cf7647a4e3c98cab0046e8342e23501e278f4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 13 Jul 2021 14:58:50 +0200 Subject: net.server_epoll: Call onconnect immediately after TLS handshake completion Skips a roundtrip through the main loop in case client-first data is available already, if not then :onreadable() will set the appropriate timeout. --- net/server_epoll.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 2dfd44e8..f6a71379 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -635,8 +635,9 @@ function interface:tlshandshake() self.onwritable = nil; self.onreadable = nil; self:on("status", "ssl-handshake-complete"); - self:setwritetimeout(); self:set(true, true); + self:onconnect(); + self:onreadable(); elseif err == "wantread" then self:noise("TLS handshake to wait until readable"); self:set(true, false); -- cgit v1.2.3