util.dependencies: Log an error if the current version of LuaSec installed contains The Bug (thanks Remko)

Wed, 25 Nov 2009 15:40:33 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 25 Nov 2009 15:40:33 +0000
changeset 2169
c06fdb6b57bd
parent 2168
1a99a3bf3ce6
child 2170
2abca9cc78b1
child 2216
9e1c6b6a2ee4

util.dependencies: Log an error if the current version of LuaSec installed contains The Bug (thanks Remko)

util/dependencies.lua file | annotate | diff | comparison | revisions
--- a/util/dependencies.lua	Wed Nov 25 05:11:10 2009 +0000
+++ b/util/dependencies.lua	Wed Nov 25 15:40:33 2009 +0000
@@ -71,6 +71,11 @@
 				["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/";
 			}, "SSL/TLS support will not be available");
 	end
+else
+	local major, minor, veryminor, patched = ssl._VERSION:match("(%d+)%.(%d+)%.?(%d*)(M?)");
+	if not major or ((tonumber(major) == 0 and (tonumber(minor) or 0) <= 3 and (tonumber(veryminor) or 0) <= 2) and patched ~= "M") then
+		log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends");
+	end
 end
 
 local encodings, err = softreq "util.encodings"

mercurial