# HG changeset patch # User Matthew Wild # Date 1265922599 0 # Node ID 40a174e8cdf60b2dc9a4c18c2edf92ab6fda8214 # Parent 187cd90860cb897165e45ee9424de4869fb00d71 net.server_select: Fix traceback with no LuaSec available (thanks Nolan) diff -r 187cd90860cb -r 40a174e8cdf6 net/server_select.lua --- 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