Diff

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
line wrap: on
line diff
--- a/net/server_epoll.lua	Wed May 02 19:20:57 2018 +0200
+++ b/net/server_epoll.lua	Wed May 02 19:29:31 2018 +0200
@@ -540,7 +540,7 @@
 
 -- Connected!
 function interface:onconnect()
-	if self.conn and not self.peername then
+	if self.conn and not self.peername and self.conn.getpeername then
 		self.peername, self.peerport = self.conn:getpeername();
 	end
 	self.onconnect = noop;