util.dependencies: Log an error if the current version of LuaSec installed contains...
authorMatthew Wild <mwild1@gmail.com>
Wed, 25 Nov 2009 15:40:33 +0000 (15:40 +0000)
committerMatthew Wild <mwild1@gmail.com>
Wed, 25 Nov 2009 15:40:33 +0000 (15:40 +0000)
util/dependencies.lua

index 6decfba5c92e616fd187a24397aa0a8bc3952fd3..790045eb1f1a7f1f3c3ff884b00cf561d5d4b832 100644 (file)
@@ -71,6 +71,11 @@ if not ssl then
                                ["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"