aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-02 17:24:25 +0200
committerKim Alvefur <zash@zash.se>2014-09-02 17:24:25 +0200
commit84a056c50b3e39b3b715d14786bf39808057f344 (patch)
treea30c886f6fca66f796055d5a0ad9b41c01d7679e /plugins/mod_s2s/mod_s2s.lua
parent763bda0975c4583ea5c3748454d9d78f021d1ee8 (diff)
downloadprosody-84a056c50b3e39b3b715d14786bf39808057f344.tar.gz
prosody-84a056c50b3e39b3b715d14786bf39808057f344.zip
mod_s2s: Close offending s2s streams missing an 'id' attribute with a stream error instead of throwing an unhandled error
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 44334428..834e6a1c 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -365,8 +365,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