aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
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
commitab57f00b936342c599aadf901f85e5b29ee91baa (patch)
treeb4ffbcba45331b7fa86a9e1d1881e94b8fef9d42 /plugins/mod_s2s/mod_s2s.lua
parente41db733ad45978e4b3193af348c220623125a0e (diff)
parent3d6dafb89a05a6aad4d102266172e377d9491360 (diff)
downloadprosody-ab57f00b936342c599aadf901f85e5b29ee91baa.tar.gz
prosody-ab57f00b936342c599aadf901f85e5b29ee91baa.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-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;