diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-02-11 21:09:59 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-02-11 21:09:59 +0000 |
commit | 0a2515bd97a9ad87d27104e82e98bb3ad56905eb (patch) | |
tree | 2d62ba144b976360bc96890e8912e868ac200fdd | |
parent | 23cbd2c45e12307a3c98e92b79c6e8db70284f56 (diff) | |
download | prosody-0a2515bd97a9ad87d27104e82e98bb3ad56905eb.tar.gz prosody-0a2515bd97a9ad87d27104e82e98bb3ad56905eb.zip |
net.server_select: Fix traceback with no LuaSec available (thanks Nolan)
-rw-r--r-- | net/server_select.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index db4475e2..e3619d30 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -55,8 +55,8 @@ local coroutine_yield = coroutine.yield --// 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 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport 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 |