Mercurial > prosody-hg
comparison util/adminstream.lua @ 12392:5373724e08a5 0.12
mod_admin_socket: Compat for luasocket prior to unix datagram support
The "socket.unix" module exported only a function before
https://github.com/lunarmodules/luasocket/commit/aa1b8cc9bc35e56de15eeb153c899e4c51de82a8
when datagram support was added.
Fixes #1717
Thanks rsc and lucas for reporting and testing
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 15 Mar 2022 10:48:46 +0100 |
| parents | 84fd6a79cda7 |
| children | 6966026262f4 |
comparison
equal
deleted
inserted
replaced
| 12391:a15647d42880 | 12392:5373724e08a5 |
|---|---|
| 137 | 137 |
| 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 | |
| 143 unix = { stream = unix }; | |
| 144 end | |
| 142 if type(unix) ~= "table" then | 145 if type(unix) ~= "table" then |
| 143 have_unix = false; | 146 have_unix = false; |
| 144 end | 147 end |
| 145 local conn, sock; | 148 local conn, sock; |
| 146 | 149 |
