diff options
author | Kim Alvefur <zash@zash.se> | 2019-10-12 20:12:04 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-10-12 20:12:04 +0200 |
commit | cabc1a2443672e086fd6e68ca8ca09f972450c82 (patch) | |
tree | 4a776184e33c642222560f1cd3d7f56b0d91c158 /net/server_epoll.lua | |
parent | ec277db6ab17f16c5cb7b8a38b16d32db111868a (diff) | |
download | prosody-cabc1a2443672e086fd6e68ca8ca09f972450c82.tar.gz prosody-cabc1a2443672e086fd6e68ca8ca09f972450c82.zip |
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.
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 7a414901..3745b426 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -605,11 +605,11 @@ end 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 |