Software / code / prosody
Comparison
util/adminstream.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 | 12852:c35afa353f8f |
comparison
equal
deleted
inserted
replaced
| 12392:5373724e08a5 | 12393:6966026262f4 |
|---|---|
| 138 --- Public methods | 138 --- Public methods |
| 139 | 139 |
| 140 local function new_connection(socket_path, listeners) | 140 local function new_connection(socket_path, listeners) |
| 141 local have_unix, unix = pcall(require, "socket.unix"); | 141 local have_unix, unix = pcall(require, "socket.unix"); |
| 142 if have_unix and type(unix) == "function" then | 142 if have_unix and type(unix) == "function" then |
| 143 -- COMPAT #1717 | |
| 144 -- Before the introduction of datagram support, only the stream socket | |
| 145 -- constructor was exported instead of a module table. Due to the lack of a | |
| 146 -- proper release of LuaSocket, distros have settled on shipping either the | |
| 147 -- last RC tag or some commit since then. | |
| 148 -- Here we accomodate both variants. | |
| 143 unix = { stream = unix }; | 149 unix = { stream = unix }; |
| 144 end | 150 end |
| 145 if type(unix) ~= "table" then | 151 if type(unix) ~= "table" then |
| 146 have_unix = false; | 152 have_unix = false; |
| 147 end | 153 end |