aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 0c19b2a2..0de590ce 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -454,6 +454,7 @@ function interface:tlshandskake()
self.onreadable = nil;
self._tls = true;
self:on("status", "ssl-handshake-complete");
+ self.init = nil; -- Restore default method
self:init();
elseif err == "wantread" then
log("debug", "TLS handshake on %s to wait until readable", self);
@@ -488,6 +489,9 @@ local function wrapsocket(client, server, pattern, listeners, tls_ctx) -- luasoc
if client.getsockname then
conn.sockname, conn.sockport = client:getsockname();
end
+ if tls_ctx then
+ conn.init = interface.starttls;
+ end
return conn;
end
@@ -507,12 +511,8 @@ end
-- Initialization
function interface:init()
- if self.tls_ctx and not self._tls then
- return self:starttls();
- else
- self:setwritetimeout();
- return self:setflags(true, true);
- end
+ self:setwritetimeout();
+ return self:setflags(true, true);
end
function interface:pause()