Comparison

plugins/mod_admin_socket.lua @ 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
parent 12392:5373724e08a5
child 12418:dd47adf74e93
comparison
equal deleted inserted replaced
12392:5373724e08a5 12393:6966026262f4
1 module:set_global(); 1 module:set_global();
2 2
3 local have_unix, unix = pcall(require, "socket.unix"); 3 local have_unix, unix = pcall(require, "socket.unix");
4 4
5 if have_unix and type(unix) == "function" then 5 if have_unix and type(unix) == "function" then
6 -- COMPAT #1717
7 -- Before the introduction of datagram support, only the stream socket
8 -- constructor was exported instead of a module table. Due to the lack of a
9 -- proper release of LuaSocket, distros have settled on shipping either the
10 -- last RC tag or some commit since then.
11 -- Here we accomodate both variants.
6 unix = { stream = unix }; 12 unix = { stream = unix };
7 end 13 end
8 if not have_unix or type(unix) ~= "table" then 14 if not have_unix or type(unix) ~= "table" then
9 module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date"); 15 module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date");
10 return; 16 return;