Mercurial > prosody-hg
comparison plugins/mod_admin_socket.lua @ 12415:01ba67e7f824
Merge 0.12->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 19 Mar 2022 09:28:59 +0000 |
| parents | 6966026262f4 |
| children | dd47adf74e93 |
comparison
equal
deleted
inserted
replaced
| 12413:e155f4509954 | 12415:01ba67e7f824 |
|---|---|
| 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 | |
| 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. | |
| 12 unix = { stream = unix }; | |
| 13 end | |
| 5 if not have_unix or type(unix) ~= "table" then | 14 if not have_unix or type(unix) ~= "table" then |
| 6 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"); |
| 7 return; | 16 return; |
| 8 end | 17 end |
| 9 | 18 |
