Changeset

10854:472fe13a05f9

net.server_epoll: Handle missing ports from getsock/peername (as in the case of unix sockets)
author Matthew Wild <mwild1@gmail.com>
date Mon, 01 Jun 2020 14:26:11 +0100
parents 10853:0107ed6744aa
children 10855:70ac7d23673d
files net/server_epoll.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Mon Jun 01 13:43:35 2020 +0100
+++ b/net/server_epoll.lua	Mon Jun 01 14:26:11 2020 +0100
@@ -619,11 +619,11 @@
 	local conn = self.conn;
 	local ok, peername, peerport = pcall(conn.getpeername, conn);
 	if ok and peername then
-		self.peername, self.peerport = peername, peerport;
+		self.peername, self.peerport = peername, peerport or 0;
 	end
 	local ok, sockname, sockport = pcall(conn.getsockname, conn);
 	if ok and sockname then
-		self.sockname, self.sockport = sockname, sockport;
+		self.sockname, self.sockport = sockname, sockport or 0;
 	end
 end