Changeset

4426:ee65aa40ef60

util.dependencies, util.xmppstream: Move LuaExpat version checking to util.dependencies.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 22 Nov 2011 02:13:42 +0500
parents 4425:6f5ed0f4a3e6
children 4427:ae71ae5ddcfc
files util/dependencies.lua util/xmppstream.lua
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/util/dependencies.lua	Tue Nov 22 01:44:28 2011 +0500
+++ b/util/dependencies.lua	Tue Nov 22 02:13:42 2011 +0500
@@ -136,6 +136,14 @@
 			log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends");
 		end
 	end
+	if lxp then
+		if not pcall(lxp.new, { StartDoctypeDecl = false }) then
+			log("error", "The version of LuaExpat on your system leaves Prosody "
+				.."vulnerable to denial-of-service attacks. You should upgrade to "
+				.."LuaExpat 1.1.1 or higher as soon as possible. See "
+				.."http://prosody.im/doc/depends#luaexpat for more information.");
+		end
+	end
 end
 
 return _M;
--- a/util/xmppstream.lua	Tue Nov 22 01:44:28 2011 +0500
+++ b/util/xmppstream.lua	Tue Nov 22 02:13:42 2011 +0500
@@ -20,13 +20,6 @@
 
 -- COMPAT: w/LuaExpat 1.1.0
 local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false });
-if not lxp_supports_doctype then
-	local default_log = require "util.logger".init("xmppstream");
-	default_log("warn", "The version of LuaExpat on your system leaves Prosody "
-		.."vulnerable to denial-of-service attacks. You should upgrade to "
-		.."LuaExpat 1.1.1 or higher as soon as possible. See "
-		.."http://prosody.im/doc/depends#luaexpat for more information.");
-end
 
 module "xmppstream"