Software /
code /
prosody
Diff
net/server_epoll.lua @ 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 |
parent | 10847:42c8dce6e765 |
child | 10861:e12690a37795 |
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