Comparison

net/server_epoll.lua @ 7600:a18532076efe

net.server_epoll: Trigger onconnect for TLS connections when writable after handshake
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 17:15:32 +0200
parent 7599:afbda0bd9cfc
child 7601:ce20546d7714
comparison
equal deleted inserted replaced
7599:afbda0bd9cfc 7600:a18532076efe
402 self:setflags(true, true); 402 self:setflags(true, true);
403 local old = self._tls; 403 local old = self._tls;
404 self._tls = true; 404 self._tls = true;
405 self.starttls = false; 405 self.starttls = false;
406 if old == false then 406 if old == false then
407 self:on("connect"); 407 self.onwriteable = interface.onconnect;
408 self:setflags(false, true);
409 self:setwritetimeout();
408 else 410 else
411 self:setflags(true, true);
409 self:on("status", "ssl-handshake-complete"); 412 self:on("status", "ssl-handshake-complete");
410 end 413 end
411 elseif err == "wantread" then 414 elseif err == "wantread" then
412 log("debug", "TLS handshake on %s to wait until readable", tostring(self)); 415 log("debug", "TLS handshake on %s to wait until readable", tostring(self));
413 self:setflags(true, false); 416 self:setflags(true, false);