aboutsummaryrefslogtreecommitdiffstats
path: root/util/adminstream.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-03-15 10:48:46 +0100
committerKim Alvefur <zash@zash.se>2022-03-15 10:48:46 +0100
commit8e5fec3220ced0c1c912bf63a84fc60f777c6607 (patch)
treeaa8b8663d9c848b65143c70b1163e693bc232e87 /util/adminstream.lua
parentba11d641910a93c898832ed36c3dc783c33ac06f (diff)
downloadprosody-8e5fec3220ced0c1c912bf63a84fc60f777c6607.tar.gz
prosody-8e5fec3220ced0c1c912bf63a84fc60f777c6607.zip
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
Diffstat (limited to 'util/adminstream.lua')
-rw-r--r--util/adminstream.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/adminstream.lua b/util/adminstream.lua
index 703deb07..8611310a 100644
--- a/util/adminstream.lua
+++ b/util/adminstream.lua
@@ -139,6 +139,9 @@ end
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