Software /
code /
prosody
Changeset
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 |
parents | 2596:187cd90860cb |
children | 2598:8a021b304765 |
files | net/server_select.lua |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
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