aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-02-12 02:50:57 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-02-12 02:50:57 +0500
commitb057bc127d27b5fa2d3ea793b3db6ff865b9a682 (patch)
treeec48a631e1bf15351fa150198b0f0cdf6a7bcdc5 /net/server_select.lua
parent91d9bb9a66577c05711d57db4eb9eb05111cc14a (diff)
parent6a135d14bd6d16953e2f698d5e0c0bcee8496797 (diff)
downloadprosody-b057bc127d27b5fa2d3ea793b3db6ff865b9a682.tar.gz
prosody-b057bc127d27b5fa2d3ea793b3db6ff865b9a682.zip
Merge with trunk.
Diffstat (limited to 'net/server_select.lua')
-rw-r--r--net/server_select.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index db4475e2..685cd13e 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 //--
@@ -472,7 +472,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
_sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist
_ = needtls and handler:starttls(nil, true)
_writetimes[ handler ] = nil
- _ = toclose and handler.close( )
+ _ = toclose and handler.close( )
return true
elseif byte and ( err == "timeout" or err == "wantwrite" ) then -- want write
buffer = string_sub( buffer, byte + 1, bufferlen ) -- new buffer
@@ -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