Changeset

11699:1275dad71afd

net.server_epoll: Use only fatal "write" timeout during TLS negotiation Only real difference between the read and write timeouts is that the former has a callback that allows the higher levels to keep the connection alive, while hitting the later is immediately fatal. We want the later behavior for TLS negotiation.
author Kim Alvefur <zash@zash.se>
date Fri, 16 Jul 2021 17:10:09 +0200
parents 11698:9a2a98621c73
children 11700:79d30de13fdb
files net/server_epoll.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Fri Jul 16 15:40:08 2021 +0200
+++ b/net/server_epoll.lua	Fri Jul 16 17:10:09 2021 +0200
@@ -600,7 +600,7 @@
 		self.onwritable = interface.inittls;
 		self.onreadable = interface.inittls;
 		self:set(true, true);
-		self:setreadtimeout(cfg.ssl_handshake_timeout);
+		self:setreadtimeout(false);
 		self:setwritetimeout(cfg.ssl_handshake_timeout);
 		self:debug("Prepared to start TLS");
 	end
@@ -651,7 +651,7 @@
 	if now then
 		return self:tlshandshake()
 	end
-	self:setreadtimeout(cfg.ssl_handshake_timeout);
+	self:setreadtimeout(false);
 	self:setwritetimeout(cfg.ssl_handshake_timeout);
 	self:set(true, true);
 end
@@ -677,7 +677,7 @@
 	elseif err == "wantread" then
 		self:noise("TLS handshake to wait until readable");
 		self:set(true, false);
-		self:setreadtimeout(cfg.ssl_handshake_timeout);
+		self:setwritetimeout(cfg.ssl_handshake_timeout);
 	elseif err == "wantwrite" then
 		self:noise("TLS handshake to wait until writable");
 		self:set(false, true);