From ee7b432ab1d450a42fae24b37c79b7fbda7f4e6b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 22 Oct 2008 17:36:21 +0100 Subject: Abstract connections with "connection listeners" - Added connlistener for xmppclient - SASL/TLS now use a new session:reset_stream() method - main.lua on its way to being a bit neater --- core/sessionmanager.lua | 2 +- core/xmlhandlers.lua | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 4f8b1913..3a5625cb 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -20,7 +20,7 @@ local getmetatable = getmetatable; module "sessionmanager" function new_session(conn) - local session = { conn = conn, notopen = true, priority = 0, type = "c2s_unauthed" }; + local session = { conn = conn, priority = 0, type = "c2s_unauthed" }; if true then session.trace = newproxy(true); getmetatable(session.trace).__gc = function () print("Session got collected") end; diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index ebc8f91d..b1af299f 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -1,5 +1,4 @@ -local sessionmanager_streamopened = require "core.sessionmanager".streamopened; require "util.stanza" local st = stanza; @@ -16,7 +15,7 @@ local error = error; module "xmlhandlers" -function init_xmlhandlers(session) +function init_xmlhandlers(session, streamopened) local ns_stack = { "" }; local curr_ns = ""; local curr_tag; @@ -38,7 +37,7 @@ function init_xmlhandlers(session) if not stanza then if session.notopen then if name == "stream" then - sessionmanager_streamopened(session, attr); + streamopened(session, attr); return; end error("Client failed to open stream successfully"); -- cgit v1.2.3