Changeset

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
parents 97:c3f12fd0c823
children 99:ba08b8a4eeef
files net/server.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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