From 32b9b7ff472476c74c5e0d83b8712066b8de0d39 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 9 Apr 2014 14:01:02 -0400 Subject: util.dependencies: Check for Lua 5.1. We don't currently support any other versions. LuaJIT identifies as 5.1. --- util/dependencies.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util') diff --git a/util/dependencies.lua b/util/dependencies.lua index e55b2405..4d50cf63 100644 --- a/util/dependencies.lua +++ b/util/dependencies.lua @@ -49,6 +49,14 @@ package.preload["util.ztact"] = function () end; function check_dependencies() + if _VERSION ~= "Lua 5.1" then + print "***********************************" + print("Unsupported Lua version: ".._VERSION); + print("Only Lua 5.1 is supported."); + print "***********************************" + return false; + end + local fatal; local lxp = softreq "lxp" -- cgit v1.2.3 From 5d027d7f71fb0410b9c1a4ad46d94aaebb87c645 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 10 Apr 2014 00:24:29 +0200 Subject: prosodyctl, util.prosodyctl: Update to reflect that mod_posix gets loaded by default on posix platforms --- util/prosodyctl.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index fe862114..d59c163c 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -189,8 +189,8 @@ function getpid() return false, "no-pidfile"; end - local modules_enabled = set.new(config.get("*", "modules_enabled")); - if not modules_enabled:contains("posix") then + local modules_enabled = set.new(config.get("*", "modules_disabled")); + if prosody.platform ~= "posix" or modules_enabled:contains("posix") then return false, "no-posix"; end -- cgit v1.2.3 From e06966ee436e4d461b03aaf8691fe76dcd6d588b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 10 Apr 2014 13:13:07 +0200 Subject: mod_c2s, mod_s2s, mod_component, util.xmppstream: Move all session:open_stream() functions to util.xmppstream --- util/xmppstream.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'util') diff --git a/util/xmppstream.lua b/util/xmppstream.lua index 586ad5f9..1e65919b 100644 --- a/util/xmppstream.lua +++ b/util/xmppstream.lua @@ -241,6 +241,22 @@ function new(session, stream_callbacks, stanza_size_limit) local parser = new_parser(handlers, ns_separator, false); local parse = parser.parse; + function session.open_stream(session, from, to) + local send = session.sends2s or session.send; + + local attr = { + ["xmlns:stream"] = "http://etherx.jabber.org/streams", + ["xml:lang"] = "en", + xmlns = stream_callbacks.default_ns, + version = session.version and (session.version > 0 and "1.0" or nil), + id = session.streamid or "", + from = from or session.host, to = to, + }; + send(""); + send(st.stanza("stream:stream", attr):top_tag()); + return true; + end + return { reset = function () parser = new_parser(handlers, ns_separator, false); -- cgit v1.2.3