aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-12 16:21:16 +0200
committerKim Alvefur <zash@zash.se>2018-10-12 16:21:16 +0200
commit4cc41d35f2ae11f8420e8f5cf503ca0b33751515 (patch)
tree7487fa9b5c7ad9431155d7fdaced84cc734cf85a /util
parent9ddebb7bbfb3334492251804feb8097b204e205f (diff)
downloadprosody-4cc41d35f2ae11f8420e8f5cf503ca0b33751515.tar.gz
prosody-4cc41d35f2ae11f8420e8f5cf503ca0b33751515.zip
util.dependencies: Add compat code for normalization of socket constructors
Old LuaSocket had only tcp() which was IPv4-only. LuaSocket ~3.0 adds a tcp6() that creates a IPv6 socket. Some version moves tcp() to tcp4() and adds an IP-version-agnostic tcp() constructor.
Diffstat (limited to 'util')
-rw-r--r--util/dependencies.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/dependencies.lua b/util/dependencies.lua
index 9b0afd77..8dc867e8 100644
--- a/util/dependencies.lua
+++ b/util/dependencies.lua
@@ -77,6 +77,10 @@ local function check_dependencies()
["Source"] = "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/";
});
fatal = true;
+ elseif not socket.tcp4 then
+ -- COMPAT LuaSocket before being IP-version agnostic
+ socket.tcp4 = socket.tcp;
+ socket.udp4 = socket.udp;
end
local lfs, err = softreq "lfs"