Software /
code /
prosody
Diff
plugins/mod_s2s/mod_s2s.lua @ 6847:c314e9142e9d
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 24 Sep 2015 20:15:19 +0200 |
parent | 6690:b2e89583d6e6 |
parent | 6846:7eb166fa1f26 |
child | 6861:39789f1669cb |
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua Tue Sep 22 01:31:52 2015 +0200 +++ b/plugins/mod_s2s/mod_s2s.lua Thu Sep 24 20:15:19 2015 +0200 @@ -354,8 +354,13 @@ (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or session.ip or "unknown host"); end - log("debug", "Sending stream features: %s", tostring(features)); - session.sends2s(features); + if ( session.type == "s2sin" or session.type == "s2sout" ) or features.tags[1] then + log("debug", "Sending stream features: %s", tostring(features)); + session.sends2s(features); + else + (session.log or log)("warn", "No features to offer, giving up"); + session:close({ condition = "undefined-condition", text = "No features to offer" }); + end end elseif session.direction == "outgoing" then session.notopen = nil;