Comparison

core/stanza_router.lua @ 10245:88efdfb0a126

core.stanza_router: Handle s2s in more direction-agnostic way
author Kim Alvefur <zash@zash.se>
date Sat, 07 Sep 2019 17:34:56 +0200
parent 10104:3965081809ba
child 10360:64ddcbc9a328
comparison
equal deleted inserted replaced
10244:483cc47f15f8 10245:88efdfb0a126
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;