aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-07-05 19:05:25 +0200
committerTobias Markmann <tm@ayena.de>2009-07-05 19:05:25 +0200
commitfa97be5e4dcd83cd57c51e764f6aa2a39b9833ba (patch)
tree04f1aa322632a0221c225ee6957b5863755a3b6d /core/stanza_router.lua
parent4ce313959b678592a5fe0ef30b6813d058de45af (diff)
parent2c3ccf56744975a5f5acbc66d2e917e056467965 (diff)
downloadprosody-fa97be5e4dcd83cd57c51e764f6aa2a39b9833ba.tar.gz
prosody-fa97be5e4dcd83cd57c51e764f6aa2a39b9833ba.zip
Merge with main branch.
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index d3bd2445..5bf437f9 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -173,12 +173,16 @@ function core_route_stanza(origin, stanza)
core_post_stanza(origin, stanza);
elseif origin.type == "c2s" then
-- Remote host
- local xmlns = stanza.attr.xmlns;
- --stanza.attr.xmlns = "jabber:server";
- stanza.attr.xmlns = nil;
- log("debug", "sending s2s stanza: %s", tostring(stanza));
- send_s2s(origin.host, host, stanza); -- TODO handle remote routing errors
- stanza.attr.xmlns = xmlns; -- reset
+ if not hosts[from_host].disallow_s2s then
+ local xmlns = stanza.attr.xmlns;
+ --stanza.attr.xmlns = "jabber:server";
+ stanza.attr.xmlns = nil;
+ log("debug", "sending s2s stanza: %s", tostring(stanza));
+ send_s2s(origin.host, host, stanza); -- TODO handle remote routing errors
+ stanza.attr.xmlns = xmlns; -- reset
+ else
+ core_route_stanza(hosts[from_host], st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote servers is not allowed"));
+ end
elseif origin.type == "component" or origin.type == "local" then
-- Route via s2s for components and modules
log("debug", "Routing outgoing stanza for %s to %s", from_host, host);