aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_socket.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_admin_socket.lua')
-rw-r--r--plugins/mod_admin_socket.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua
index b197adae..ffea9c61 100644
--- a/plugins/mod_admin_socket.lua
+++ b/plugins/mod_admin_socket.lua
@@ -2,6 +2,15 @@ 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
module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date");
return;