aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-08 23:20:22 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-08 23:20:22 +0100
commit921fe046e5e580f57bd20353ec1997c356c02e64 (patch)
tree7d45dca20909451cfa4b5fa05355357f4374ec31 /core/sessionmanager.lua
parentedd59b5d381bd8b0daee063a99f8678f86f6b9bb (diff)
downloadprosody-921fe046e5e580f57bd20353ec1997c356c02e64.tar.gz
prosody-921fe046e5e580f57bd20353ec1997c356c02e64.zip
sessionmanager, componentmanager: Fix some wacky indentation (thanks greyback!)
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua46
1 files changed, 22 insertions, 24 deletions
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 <stream:stream> to %s", session.host);
-
-
- send("<?xml version='1.0'?>");
- send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0'>", 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 <stream:stream> to %s", session.host);
+
+ send("<?xml version='1.0'?>");
+ send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0'>", 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 <stream:stream> 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 <stream:stream> to client");
+ session.notopen = nil;
end
function streamclosed(session)