# HG changeset patch # User Kim Alvefur # Date 1647337726 -3600 # Node ID 5373724e08a5b1c89331ed121d19551c334cfc81 # Parent a15647d42880658bc7fb095792283551bee64b45 mod_admin_socket: Compat for luasocket prior to unix datagram support The "socket.unix" module exported only a function before https://github.com/lunarmodules/luasocket/commit/aa1b8cc9bc35e56de15eeb153c899e4c51de82a8 when datagram support was added. Fixes #1717 Thanks rsc and lucas for reporting and testing diff -r a15647d42880 -r 5373724e08a5 plugins/mod_admin_socket.lua --- a/plugins/mod_admin_socket.lua Tue Mar 15 21:59:51 2022 +0100 +++ b/plugins/mod_admin_socket.lua Tue Mar 15 10:48:46 2022 +0100 @@ -2,6 +2,9 @@ local have_unix, unix = pcall(require, "socket.unix"); +if have_unix and type(unix) == "function" then + unix = { stream = unix }; +end if not have_unix or type(unix) ~= "table" then module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date"); return; diff -r a15647d42880 -r 5373724e08a5 util/adminstream.lua --- a/util/adminstream.lua Tue Mar 15 21:59:51 2022 +0100 +++ b/util/adminstream.lua Tue Mar 15 10:48:46 2022 +0100 @@ -139,6 +139,9 @@ local function new_connection(socket_path, listeners) local have_unix, unix = pcall(require, "socket.unix"); + if have_unix and type(unix) == "function" then + unix = { stream = unix }; + end if type(unix) ~= "table" then have_unix = false; end