Diff

net/server_select.lua @ 2597:40a174e8cdf6

net.server_select: Fix traceback with no LuaSec available (thanks Nolan)
author Matthew Wild <mwild1@gmail.com>
date Thu, 11 Feb 2010 21:09:59 +0000
parent 2582:d6afb6d919df
child 2598:8a021b304765
line wrap: on
line diff
--- a/net/server_select.lua	Fri Feb 12 02:15:54 2010 +0500
+++ b/net/server_select.lua	Thu Feb 11 21:09:59 2010 +0000
@@ -55,8 +55,8 @@
 
 --// extern libs //--
 
-local luasec = select( 2, pcall( require, "ssl" ) )
-local luasocket = require "socket"
+local luasec = use "ssl"
+local luasocket = use "socket" or require "socket"
 
 --// extern lib methods //--
 
@@ -601,8 +601,10 @@
 			handler.readbuffer = _readbuffer
 			handler.sendbuffer = _sendbuffer
 		end
+	else
+		handler.readbuffer = _readbuffer
+		handler.sendbuffer = _sendbuffer
 	end
-
 	send = socket.send
 	receive = socket.receive
 	shutdown = ( ssl and id ) or socket.shutdown