Comparison

net/server_epoll.lua @ 8778:0364454bdd77

net.server_epoll: Guard against connection missing the getpeername method (thanks LuaSec)
author Kim Alvefur <zash@zash.se>
date Wed, 02 May 2018 19:29:31 +0200
parent 8777:2bfe963f3041
child 8781:53178b6ba589
comparison
equal deleted inserted replaced
8777:2bfe963f3041 8778:0364454bdd77
538 end); 538 end);
539 end 539 end
540 540
541 -- Connected! 541 -- Connected!
542 function interface:onconnect() 542 function interface:onconnect()
543 if self.conn and not self.peername then 543 if self.conn and not self.peername and self.conn.getpeername then
544 self.peername, self.peerport = self.conn:getpeername(); 544 self.peername, self.peerport = self.conn:getpeername();
545 end 545 end
546 self.onconnect = noop; 546 self.onconnect = noop;
547 self:on("connect"); 547 self:on("connect");
548 end 548 end