From 7a2fc45f65a14933f2ab8e83d6ae9487b59e6a79 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 1 Nov 2008 18:28:46 +0000 Subject: General fixes for s2s, to make it more robust (I hope), sending data to remote hosts sane (s2ssession.send() works as expected), recycle outgoing dialback connections, etc. --- core/stanza_router.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/stanza_router.lua') diff --git a/core/stanza_router.lua b/core/stanza_router.lua index e98d6794..3333354e 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -23,7 +23,7 @@ local jid_split = require "util.jid".split; local print = print; function core_process_stanza(origin, stanza) - log("debug", "Received: "..tostring(stanza)) + log("debug", "Received["..origin.type.."]: "..tostring(stanza)) -- TODO verify validity of stanza (as well as JID validity) if stanza.name == "iq" and not(#stanza.tags == 1 and stanza.tags[1].attr.xmlns) then if stanza.attr.type == "set" or stanza.attr.type == "get" then @@ -137,9 +137,9 @@ function core_handle_stanza(origin, stanza) origin.from_host = attr.from; origin.to_host = attr.to; origin.dialback_key = stanza[1]; - log("debug", "asking %s if key %s belongs to them", attr.from, stanza[1]); - send_s2s(attr.to, attr.from, format("%s", attr.to, attr.from, origin.streamid, stanza[1])); - hosts[attr.from].dialback_verifying = origin; + log("debug", "asking %s if key %s belongs to them", origin.from_host, origin.dialback_key); + send_s2s(origin.to_host, origin.from_host, format("%s", origin.to_host, origin.from_host, origin.streamid, origin.dialback_key)); + hosts[origin.from_host].dialback_verifying = origin; end end elseif origin.type == "s2sout_unauthed" or origin.type == "s2sout" then -- cgit v1.2.3