diff options
author | Kim Alvefur <zash@zash.se> | 2022-03-15 10:48:46 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-03-15 10:48:46 +0100 |
commit | 8e5fec3220ced0c1c912bf63a84fc60f777c6607 (patch) | |
tree | aa8b8663d9c848b65143c70b1163e693bc232e87 /plugins/mod_admin_socket.lua | |
parent | ba11d641910a93c898832ed36c3dc783c33ac06f (diff) | |
download | prosody-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 'plugins/mod_admin_socket.lua')
-rw-r--r-- | plugins/mod_admin_socket.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua index b197adae..5eaef2e7 100644 --- a/plugins/mod_admin_socket.lua +++ b/plugins/mod_admin_socket.lua @@ -2,6 +2,9 @@ module:set_global(); 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; |