Changeset

10082:1df53ef1f60d

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
author Kim Alvefur <zash@zash.se>
date Tue, 23 Jul 2019 18:06:34 +0200
parents 10081:72adf1f39404
children 10083:f30d505e755b
files net/server_epoll.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Sat May 25 16:14:31 2019 +0200
+++ b/net/server_epoll.lua	Tue Jul 23 18:06:34 2019 +0200
@@ -694,6 +694,7 @@
 		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);