aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_event.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_event.lua
parent91d9bb9a66577c05711d57db4eb9eb05111cc14a (diff)
parent6a135d14bd6d16953e2f698d5e0c0bcee8496797 (diff)
downloadprosody-b057bc127d27b5fa2d3ea793b3db6ff865b9a682.tar.gz
prosody-b057bc127d27b5fa2d3ea793b3db6ff865b9a682.zip
Merge with trunk.
Diffstat (limited to 'net/server_event.lua')
-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 )