Comparison

net/server_epoll.lua @ 7627:d8126298c729

net.server_epoll: Let :init handle setup for onconnect handling
author Kim Alvefur <zash@zash.se>
date Mon, 22 Aug 2016 17:22:34 +0200
parent 7626:e56343d50293
child 7628:7f2159eac697
comparison
equal deleted inserted replaced
7626:e56343d50293 7627:d8126298c729
416 self:setflags(true, true); 416 self:setflags(true, true);
417 local old = self._tls; 417 local old = self._tls;
418 self._tls = true; 418 self._tls = true;
419 self.starttls = false; 419 self.starttls = false;
420 if old == false then 420 if old == false then
421 self.onwriteable = interface.onconnect; 421 self:init();
422 self:setflags(false, true);
423 self:setwritetimeout();
424 else 422 else
425 self:setflags(true, true); 423 self:setflags(true, true);
426 self:on("status", "ssl-handshake-complete"); 424 self:on("status", "ssl-handshake-complete");
427 end 425 end
428 elseif err == "wantread" then 426 elseif err == "wantread" then
446 conn = client; 444 conn = client;
447 server = server; 445 server = server;
448 created = gettime(); 446 created = gettime();
449 listeners = listeners; 447 listeners = listeners;
450 _pattern = pattern or server._pattern; 448 _pattern = pattern or server._pattern;
451 onwriteable = interface.onconnect;
452 writebuffer = {}; 449 writebuffer = {};
453 tls = tls; 450 tls = tls;
454 }, interface_mt); 451 }, interface_mt);
455 452
456 if client.getpeername then 453 if client.getpeername then