Software /
code /
prosody
Comparison
core/s2smanager.lua @ 255:43a9683bcd19
Fix for detecting when we are routing a stanza to ourself (I'm sure this has something to do with you, waqas...)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 14 Nov 2008 02:20:46 +0000 |
parent | 254:6eb3dea1d68b |
child | 256:c14ddd0912a2 |
comparison
equal
deleted
inserted
replaced
254:6eb3dea1d68b | 255:43a9683bcd19 |
---|---|
2 local hosts = hosts; | 2 local hosts = hosts; |
3 local sessions = sessions; | 3 local sessions = sessions; |
4 local socket = require "socket"; | 4 local socket = require "socket"; |
5 local format = string.format; | 5 local format = string.format; |
6 local t_insert = table.insert; | 6 local t_insert = table.insert; |
7 local get_traceback = debug.traceback; | |
7 local tostring, pairs, ipairs, getmetatable, print, newproxy, error, tonumber | 8 local tostring, pairs, ipairs, getmetatable, print, newproxy, error, tonumber |
8 = tostring, pairs, ipairs, getmetatable, print, newproxy, error, tonumber; | 9 = tostring, pairs, ipairs, getmetatable, print, newproxy, error, tonumber; |
9 | 10 |
10 local connlisteners_get = require "net.connlisteners".get; | 11 local connlisteners_get = require "net.connlisteners".get; |
11 local wraptlsclient = require "net.server".wraptlsclient; | 12 local wraptlsclient = require "net.server".wraptlsclient; |
42 end | 43 end |
43 | 44 |
44 -- Queue stanza until we are able to send it | 45 -- Queue stanza until we are able to send it |
45 if host.sendq then t_insert(host.sendq, data); | 46 if host.sendq then t_insert(host.sendq, data); |
46 else host.sendq = { data }; end | 47 else host.sendq = { data }; end |
48 elseif host.type == "local" or host.type == "component" then | |
49 log("error", "Trying to send a stanza to ourselves??") | |
50 log("error", "Traceback: "..get_traceback()); | |
47 else | 51 else |
48 (host.log or log)("debug", "going to send stanza to "..to_host.." from "..from_host); | 52 (host.log or log)("debug", "going to send stanza to "..to_host.." from "..from_host); |
49 -- FIXME | 53 -- FIXME |
50 if hosts[to_host].from_host ~= from_host then | 54 if hosts[to_host].from_host ~= from_host then |
51 log("error", "WARNING! This might, possibly, be a bug, but it might not..."); | 55 log("error", "WARNING! This might, possibly, be a bug, but it might not..."); |