aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/server_select.lua')
-rw-r--r--net/server_select.lua8
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