From 921fe046e5e580f57bd20353ec1997c356c02e64 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 8 Apr 2009 23:20:22 +0100 Subject: sessionmanager, componentmanager: Fix some wacky indentation (thanks greyback!) --- core/componentmanager.lua | 6 +++--- core/sessionmanager.lua | 46 ++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/core/componentmanager.lua b/core/componentmanager.lua index 5efb1f51..1da8cd6f 100644 --- a/core/componentmanager.lua +++ b/core/componentmanager.lua @@ -73,9 +73,9 @@ function handle_stanza(origin, stanza) end function create_component(host, component) - -- TODO check for host well-formedness - local session = session or { type = "component", host = host, connected = true, s2sout = {}, send = component }; - return session; + -- TODO check for host well-formedness + local session = session or { type = "component", host = host, connected = true, s2sout = {}, send = component }; + return session; end function register_component(host, component, session) diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 1232922f..52e418cc 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -155,31 +155,29 @@ function bind_resource(session, resource) end function streamopened(session, attr) - local send = session.send; - session.host = attr.to or error("Client failed to specify destination hostname"); - session.host = nameprep(session.host); - session.version = tonumber(attr.version) or 0; - session.streamid = m_random(1000000, 99999999); - (session.log or session)("debug", "Client sent opening to %s", session.host); - - - send(""); - send(format("", session.streamid, session.host)); - - if not hosts[session.host] then - -- We don't serve this host... - session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)}; - return; - end - - - local features = st.stanza("stream:features"); - fire_event("stream-features", session, features); - - send(features); + local send = session.send; + session.host = attr.to or error("Client failed to specify destination hostname"); + session.host = nameprep(session.host); + session.version = tonumber(attr.version) or 0; + session.streamid = m_random(1000000, 99999999); + (session.log or session)("debug", "Client sent opening to %s", session.host); + + send(""); + send(format("", session.streamid, session.host)); + + if not hosts[session.host] then + -- We don't serve this host... + session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)}; + return; + end - (session.log or log)("info", "Sent reply to client"); - session.notopen = nil; + local features = st.stanza("stream:features"); + fire_event("stream-features", session, features); + + send(features); + + (session.log or log)("info", "Sent reply to client"); + session.notopen = nil; end function streamclosed(session) -- cgit v1.2.3