net.server_epoll: Handle missing ports from getsock/peername (as in the case of unix sockets)

This commit is contained in:
Matthew Wild 2020-06-01 14:26:11 +01:00
parent 610be29e2a
commit 6ccd66e347

View file

@ -619,11 +619,11 @@ function interface:updatenames()
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