aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-11 21:32:49 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-11 21:32:49 +0000
commit6a135d14bd6d16953e2f698d5e0c0bcee8496797 (patch)
tree79efa296b17ab93853d71a8f27751c111cb8ed78 /net
parent89d2043ed8c7a16d020821692f39d4ab3415cde2 (diff)
downloadprosody-6a135d14bd6d16953e2f698d5e0c0bcee8496797.tar.gz
prosody-6a135d14bd6d16953e2f698d5e0c0bcee8496797.zip
net.server_event: Fixes for traceback with no LuaSec
Diffstat (limited to 'net')
-rw-r--r--net/server_event.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index 3afc732b..e79a57d0 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -43,7 +43,7 @@ local tostring = use "tostring"
local coroutine = use "coroutine"
local setmetatable = use "setmetatable"
-local ssl = use "ssl" or require "ssl"
+local ssl = use "ssl"
local socket = use "socket" or require "socket"
local log = require ("util.logger").init("socket")
@@ -142,7 +142,7 @@ do
self:_close()
debug( "new connection failed. id:", self.id, "error:", self.fatalerror )
else
- if plainssl then -- start ssl session
+ if plainssl and ssl then -- start ssl session
self:starttls()
else -- normal connection
self:_start_session( self.listener.onconnect )
@@ -489,6 +489,7 @@ do
_sslctx = sslctx; -- parameters
_usingssl = false; -- client is using ssl;
}
+ if not ssl then interface.starttls = false; end
interface.id = tostring(interface):match("%x+$");
interface.writecallback = function( event ) -- called on write events
--vdebug( "new client write event, id/ip/port:", interface, ip, port )
@@ -670,7 +671,7 @@ do
interface._connections = interface._connections + 1 -- increase connection count
local clientinterface = handleclient( client, ip, port, interface, pattern, listener, nil, sslctx )
--vdebug( "client id:", clientinterface, "startssl:", startssl )
- if sslctx then
+ if ssl and sslctx then
clientinterface:starttls(sslctx)
else
clientinterface:_start_session( clientinterface.onconnect )