Software /
code /
prosody
Changeset
10330:d86b1304451a
net.server_epoll: Handle getpeer/sockname returning a normal error
These will sometimes return nil, "Transport not connected" but not throw
a hard error. This shouldn't be treated as success.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 12 Oct 2019 20:12:04 +0200 |
parents | 10329:c0a72c97e6cf |
children | 10331:76bd77ad6a2a |
files | net/server_epoll.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server_epoll.lua Sat Oct 12 20:07:50 2019 +0200 +++ b/net/server_epoll.lua Sat Oct 12 20:12:04 2019 +0200 @@ -605,11 +605,11 @@ function interface:updatenames() local conn = self.conn; local ok, peername, peerport = pcall(conn.getpeername, conn); - if ok then + if ok and peername then self.peername, self.peerport = peername, peerport; end local ok, sockname, sockport = pcall(conn.getsockname, conn); - if ok then + if ok and sockname then self.sockname, self.sockport = sockname, sockport; end end