aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-13 22:31:59 +0200
committerKim Alvefur <zash@zash.se>2015-05-13 22:31:59 +0200
commitcedc24858c35741d5131bbf4840d4f83dfb7b9bb (patch)
treea1194a8507fd6aba43f775983a36e82bbb8c2448 /plugins/mod_s2s/mod_s2s.lua
parent2f7ac943416fa13023e9d061ffc8020811a4ebf0 (diff)
parentecb35aa0e93c449e422fc385e2e2b679b7082b8c (diff)
downloadprosody-cedc24858c35741d5131bbf4840d4f83dfb7b9bb.tar.gz
prosody-cedc24858c35741d5131bbf4840d4f83dfb7b9bb.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 060e04f6..480761f4 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -166,7 +166,7 @@ end
-- Stream is authorised, and ready for normal stanzas
function mark_connected(session)
- local sendq, send = session.sendq, session.sends2s;
+ local sendq = session.sendq;
local from, to = session.from_host, session.to_host;
@@ -189,6 +189,7 @@ function mark_connected(session)
if session.direction == "outgoing" then
if sendq then
session.log("debug", "sending %d queued stanzas across new outgoing connection to %s", #sendq, session.to_host);
+ local send = session.sends2s;
for i, data in ipairs(sendq) do
send(data[1]);
sendq[i] = nil;
@@ -258,8 +259,6 @@ local stream_callbacks = { default_ns = "jabber:server", handlestanza = core_pr
local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
function stream_callbacks.streamopened(session, attr)
- local send = session.sends2s;
-
session.version = tonumber(attr.version) or 0;
-- TODO: Rename session.secure to session.encrypted
@@ -342,6 +341,7 @@ function stream_callbacks.streamopened(session, attr)
end
session:open_stream(session.to_host, session.from_host)
+ session.notopen = nil;
if session.version >= 1.0 then
local features = st.stanza("stream:features");
@@ -352,9 +352,8 @@ function stream_callbacks.streamopened(session, attr)
end
log("debug", "Sending stream features: %s", tostring(features));
- send(features);
+ session.sends2s(features);
end
- session.notopen = nil;
elseif session.direction == "outgoing" then
session.notopen = nil;
if not attr.id then