Changeset

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
parents 8777:2bfe963f3041
children 8779:11b4ae162db7
files net/server_epoll.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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;