aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-03-14 02:59:16 +0000
committerMatthew Wild <mwild1@gmail.com>2010-03-14 02:59:16 +0000
commitc42dd4c96236f0b83654d83613d7d3cf5dffef84 (patch)
tree38d4e710d314b8e99f964f8b08d348d41d5a6475 /core
parent8b94f4df2504444121a345c430538b0a409e059d (diff)
downloadprosody-c42dd4c96236f0b83654d83613d7d3cf5dffef84.tar.gz
prosody-c42dd4c96236f0b83654d83613d7d3cf5dffef84.zip
sessionmanager: Return stream error when incoming stream header is missing 'to' attribute
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index 5c40f756..264c296b 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -181,7 +181,12 @@ end
function streamopened(session, attr)
local send = session.send;
- session.host = attr.to or error("Client failed to specify destination hostname");
+ session.host = attr.to;
+ if not session.host then
+ session:close{ condition = "improper-addressing",
+ text = "A 'to' attribute is required on stream headers" };
+ return;
+ end
session.host = nameprep(session.host);
session.version = tonumber(attr.version) or 0;
session.streamid = uuid_generate();