Software /
code /
prosody
Diff
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 |
parent | 12094:84fd6a79cda7 |
child | 12393:6966026262f4 |
line wrap: on
line diff
--- a/util/adminstream.lua Tue Mar 15 21:59:51 2022 +0100 +++ b/util/adminstream.lua Tue Mar 15 10:48:46 2022 +0100 @@ -139,6 +139,9 @@ local function new_connection(socket_path, listeners) local have_unix, unix = pcall(require, "socket.unix"); + if have_unix and type(unix) == "function" then + unix = { stream = unix }; + end if type(unix) ~= "table" then have_unix = false; end