aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-07-23 18:06:34 +0200
committerKim Alvefur <zash@zash.se>2019-07-23 18:06:34 +0200
commita9f304b6bdf3c3ef34cf1db64cd0634888e6f9a7 (patch)
tree76fb342aef1377295ad04097056227918b796778
parent0efe801b5d1e0b45cb16d8fdddaa3620d6317073 (diff)
downloadprosody-a9f304b6bdf3c3ef34cf1db64cd0634888e6f9a7.tar.gz
prosody-a9f304b6bdf3c3ef34cf1db64cd0634888e6f9a7.zip
net.server_epoll: Return errors from creating sockets
Prevents error from attempting to index nil conn on such failure. Silences luacheck warning about the 'err' variable being unused
-rw-r--r--net/server_epoll.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 251f91f7..f296dd37 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -694,6 +694,7 @@ local function addclient(addr, port, listeners, read_size, tls_ctx, typ)
return nil, "invalid socket type";
end
local conn, err = create();
+ if not conn then return conn, err; end
local ok, err = conn:settimeout(0);
if not ok then return ok, err; end
local ok, err = conn:setpeername(addr, port);