aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-03-16 19:32:17 +0100
committerKim Alvefur <zash@zash.se>2022-03-16 19:32:17 +0100
commit7badf61246f39df241a0d47eb433dc93eb05b6a5 (patch)
tree9f0df734b98186536e18339c713de9f9035858dc
parent8e5fec3220ced0c1c912bf63a84fc60f777c6607 (diff)
downloadprosody-7badf61246f39df241a0d47eb433dc93eb05b6a5.tar.gz
prosody-7badf61246f39df241a0d47eb433dc93eb05b6a5.zip
mod_admin_socket: Comment on LuaSocket UNIX compat code
Ref #1717
-rw-r--r--plugins/mod_admin_socket.lua6
-rw-r--r--util/adminstream.lua6
2 files changed, 12 insertions, 0 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua
index 5eaef2e7..ffea9c61 100644
--- a/plugins/mod_admin_socket.lua
+++ b/plugins/mod_admin_socket.lua
@@ -3,6 +3,12 @@ module:set_global();
local have_unix, unix = pcall(require, "socket.unix");
if have_unix and type(unix) == "function" then
+ -- COMPAT #1717
+ -- Before the introduction of datagram support, only the stream socket
+ -- constructor was exported instead of a module table. Due to the lack of a
+ -- proper release of LuaSocket, distros have settled on shipping either the
+ -- last RC tag or some commit since then.
+ -- Here we accomodate both variants.
unix = { stream = unix };
end
if not have_unix or type(unix) ~= "table" then
diff --git a/util/adminstream.lua b/util/adminstream.lua
index 8611310a..4075aa05 100644
--- a/util/adminstream.lua
+++ b/util/adminstream.lua
@@ -140,6 +140,12 @@ end
local function new_connection(socket_path, listeners)
local have_unix, unix = pcall(require, "socket.unix");
if have_unix and type(unix) == "function" then
+ -- COMPAT #1717
+ -- Before the introduction of datagram support, only the stream socket
+ -- constructor was exported instead of a module table. Due to the lack of a
+ -- proper release of LuaSocket, distros have settled on shipping either the
+ -- last RC tag or some commit since then.
+ -- Here we accomodate both variants.
unix = { stream = unix };
end
if type(unix) ~= "table" then