Comparison

net/server_epoll.lua @ 11700:79d30de13fdb

net.server_epoll: Reduce timer churn during TLS handshake Instead of removing and readding the timer, keep it and adjust it instead. Should reduce garbage production a bit.
author Kim Alvefur <zash@zash.se>
date Sat, 17 Jul 2021 14:06:57 +0200
parent 11699:1275dad71afd
child 11701:a3572205c5bf
comparison
equal deleted inserted replaced
11699:1275dad71afd 11700:79d30de13fdb
655 self:setwritetimeout(cfg.ssl_handshake_timeout); 655 self:setwritetimeout(cfg.ssl_handshake_timeout);
656 self:set(true, true); 656 self:set(true, true);
657 end 657 end
658 658
659 function interface:tlshandshake() 659 function interface:tlshandshake()
660 self:setwritetimeout(false);
661 self:setreadtimeout(false); 660 self:setreadtimeout(false);
662 self:noise("Continuing TLS handshake"); 661 self:noise("Continuing TLS handshake");
663 local ok, err = self.conn:dohandshake(); 662 local ok, err = self.conn:dohandshake();
664 if ok then 663 if ok then
665 local info = self.conn.info and self.conn:info(); 664 local info = self.conn.info and self.conn:info();
666 if type(info) == "table" then 665 if type(info) == "table" then
667 self:debug("TLS handshake complete (%s with %s)", info.protocol, info.cipher); 666 self:debug("TLS handshake complete (%s with %s)", info.protocol, info.cipher);
668 else 667 else
669 self:debug("TLS handshake complete"); 668 self:debug("TLS handshake complete");
670 end 669 end
670 self:setwritetimeout(false);
671 self.onwritable = nil; 671 self.onwritable = nil;
672 self.onreadable = nil; 672 self.onreadable = nil;
673 self:on("status", "ssl-handshake-complete"); 673 self:on("status", "ssl-handshake-complete");
674 self:set(true, true); 674 self:set(true, true);
675 self:onconnect(); 675 self:onconnect();