# HG changeset patch # User Matthew Wild # Date 1246590267 -3600 # Node ID 95f8024c77fcda5136f5c667f9aa30ccb924dfd1 # Parent fee24339ade1a385a69cb0f3b8712071f89f3228 stanza_router: Check host.disallow_s2s before routing over s2sout. you can haz no s2s. diff -r fee24339ade1 -r 95f8024c77fc core/stanza_router.lua --- a/core/stanza_router.lua Thu Jul 02 15:23:09 2009 -0400 +++ b/core/stanza_router.lua Fri Jul 03 04:04:27 2009 +0100 @@ -173,12 +173,16 @@ 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);