aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
commitd9649edc2c6a2c22d2cdc5c8fe577deb510580bf (patch)
tree76fb342aef1377295ad04097056227918b796778 /net
parent2b596d7bd69f1c67a53c8166cc7b59cda3efce17 (diff)
downloadprosody-d9649edc2c6a2c22d2cdc5c8fe577deb510580bf.tar.gz
prosody-d9649edc2c6a2c22d2cdc5c8fe577deb510580bf.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
Diffstat (limited to 'net')
-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);