From 1b422e8f1d173e7f70db93cfec3ef499e0f9e37c Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 14 Nov 2008 02:20:46 +0000 Subject: Fix for detecting when we are routing a stanza to ourself (I'm sure this has something to do with you, waqas...) --- core/s2smanager.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index e0a6f3ca..16092ba8 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -4,6 +4,7 @@ local sessions = sessions; local socket = require "socket"; local format = string.format; local t_insert = table.insert; +local get_traceback = debug.traceback; local tostring, pairs, ipairs, getmetatable, print, newproxy, error, tonumber = tostring, pairs, ipairs, getmetatable, print, newproxy, error, tonumber; @@ -44,6 +45,9 @@ function send_to_host(from_host, to_host, data) -- Queue stanza until we are able to send it if host.sendq then t_insert(host.sendq, data); else host.sendq = { data }; end + elseif host.type == "local" or host.type == "component" then + log("error", "Trying to send a stanza to ourselves??") + log("error", "Traceback: "..get_traceback()); else (host.log or log)("debug", "going to send stanza to "..to_host.." from "..from_host); -- FIXME -- cgit v1.2.3