aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-02 22:33:11 +0200
committerKim Alvefur <zash@zash.se>2014-09-02 22:33:11 +0200
commitc80b30a71ceb555bb33d14c3c7dbee0a8c93eaee (patch)
treeb4ffbcba45331b7fa86a9e1d1881e94b8fef9d42 /plugins/mod_s2s
parenta540fdb9f448eb0990899b70e0ed8ab926e979f6 (diff)
parent69d97b4f7ed15249ce71a5b261bff98a008684aa (diff)
downloadprosody-c80b30a71ceb555bb33d14c3c7dbee0a8c93eaee.tar.gz
prosody-c80b30a71ceb555bb33d14c3c7dbee0a8c93eaee.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_s2s')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 8614b857..0a2b5bb7 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -350,8 +350,11 @@ function stream_callbacks.streamopened(session, attr)
session.notopen = nil;
elseif session.direction == "outgoing" then
session.notopen = nil;
- -- If we are just using the connection for verifying dialback keys, we won't try and auth it
- if not attr.id then error("stream response did not give us a streamid!!!"); end
+ if not attr.id then
+ log("error", "Stream response did not give us a stream id!");
+ session:close({ condition = "undefined-condition", text = "Missing stream ID" });
+ return;
+ end
session.streamid = attr.id;
if session.secure and not session.cert_chain_status then
@@ -617,6 +620,10 @@ function listener.register_outgoing(conn, session)
initialize_session(session);
end
+function listener.ondetach(conn)
+ sessions[conn] = nil;
+end
+
function check_auth_policy(event)
local host, session = event.host, event.session;
local must_secure = secure_auth;