Software /
code /
prosody
Comparison
core/stanza_router.lua @ 10434:8f709577fe8e
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 23 Nov 2019 23:12:01 +0100 |
parent | 10362:c05444119e9e |
child | 10528:48300484a124 |
comparison
equal
deleted
inserted
replaced
10433:7777f25d5266 | 10434:8f709577fe8e |
---|---|
109 from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID | 109 from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID |
110 if from_resource then from = from_bare.."/"..from_resource; else from = from_bare; end | 110 if from_resource then from = from_bare.."/"..from_resource; else from = from_bare; end |
111 stanza.attr.from = from; | 111 stanza.attr.from = from; |
112 end | 112 end |
113 | 113 |
114 if (origin.type == "s2sin" or origin.type == "c2s" or origin.type == "component") and xmlns == nil then | 114 if (origin.type == "s2sin" or origin.type == "s2sout" or origin.type == "c2s" or origin.type == "component") and xmlns == nil then |
115 if origin.type == "s2sin" and not origin.dummy then | 115 if (origin.type == "s2sin" or origin.type == "s2sout") and not origin.dummy then |
116 local host_status = origin.hosts[from_host]; | 116 local host_status = origin.hosts[from_host]; |
117 if not host_status or not host_status.authed then -- remote server trying to impersonate some other server? | 117 if not host_status or not host_status.authed then -- remote server trying to impersonate some other server? |
118 log("warn", "Received a stanza claiming to be from %s, over a stream authed for %s!", from_host, origin.from_host); | 118 log("warn", "Received a stanza claiming to be from %s, over a stream authed for %s!", from_host, origin.from_host); |
119 origin:close("not-authorized"); | 119 origin:close("not-authorized"); |
120 return; | 120 return; |
197 -- old stanza routing code removed | 197 -- old stanza routing code removed |
198 core_post_stanza(origin, stanza); | 198 core_post_stanza(origin, stanza); |
199 else | 199 else |
200 local host_session = hosts[from_host]; | 200 local host_session = hosts[from_host]; |
201 if not host_session then | 201 if not host_session then |
202 log("error", "No hosts[from_host] (please report): %s", tostring(stanza)); | 202 log("error", "No hosts[from_host] (please report): %s", stanza); |
203 else | 203 else |
204 local xmlns = stanza.attr.xmlns; | 204 local xmlns = stanza.attr.xmlns; |
205 stanza.attr.xmlns = nil; | 205 stanza.attr.xmlns = nil; |
206 local routed = host_session.events.fire_event("route/remote", { | 206 local routed = host_session.events.fire_event("route/remote", { |
207 origin = origin, stanza = stanza, from_host = from_host, to_host = host }); | 207 origin = origin, stanza = stanza, from_host = from_host, to_host = host }); |