Changeset

12393:6966026262f4 0.12

mod_admin_socket: Comment on LuaSocket UNIX compat code Ref #1717
author Kim Alvefur <zash@zash.se>
date Wed, 16 Mar 2022 19:32:17 +0100 (2022-03-16)
parents 12392:5373724e08a5
children 12414:a93e65784f2c
files plugins/mod_admin_socket.lua util/adminstream.lua
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_socket.lua	Tue Mar 15 10:48:46 2022 +0100
+++ b/plugins/mod_admin_socket.lua	Wed Mar 16 19:32:17 2022 +0100
@@ -3,6 +3,12 @@
 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
--- a/util/adminstream.lua	Tue Mar 15 10:48:46 2022 +0100
+++ b/util/adminstream.lua	Wed Mar 16 19:32:17 2022 +0100
@@ -140,6 +140,12 @@
 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