Diff

net/server.lua @ 98:3a2d327c4856

server.lua should degrade gracefully when LuaSec not present
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Oct 2008 17:27:40 +0100
parent 74:09bda2782837
child 127:93f3c6b94c75
line wrap: on
line diff
--- a/net/server.lua	Sun Oct 12 01:23:30 2008 +0100
+++ b/net/server.lua	Wed Oct 22 17:27:40 2008 +0100
@@ -43,7 +43,7 @@
 
 --// extern libs //--
 
-local luasec = require "ssl"
+local luasec = select(2, pcall(require, "ssl"))
 local luasocket = require "socket"
 
 --// extern lib methods //--
@@ -722,7 +722,7 @@
 	else
 		for name, func in pairs( listeners ) do
 			if type( func ) ~= "function" then
-				err = "invalid listener function"
+				--err = "invalid listener function"
 				break
 			end
 		end