mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
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.
This commit is contained in:
parent
50bd7b79ea
commit
d2678dfdee
1 changed files with 3 additions and 3 deletions
|
@ -600,7 +600,7 @@ function interface:starttls(tls_ctx)
|
|||
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 @@ function interface:inittls(tls_ctx, now)
|
|||
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 @@ function interface:tlshandshake()
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue