net/xmppcomponent_listener.lua

changeset 3321
dcdfc04f9e3a
parent 3320
517ae40a12a2
child 3503
85e511e01d3c
--- a/net/xmppcomponent_listener.lua	Sun Jul 04 19:15:20 2010 +0100
+++ b/net/xmppcomponent_listener.lua	Sun Jul 04 19:16:20 2010 +0100
@@ -107,6 +107,7 @@
 				local _, domain = jid_split(stanza.attr.from);
 				if domain ~= session.host then
 					-- Return error
+					session.log("warn", "Component sent stanza with missing or invalid 'from' address");
 					session:close{
 						condition = "invalid-from";
 						text = "Component tried to send from address <"..tostring(from)
@@ -119,6 +120,7 @@
 			stanza.attr.from = session.host;
 		end
 		if not stanza.attr.to then
+			session.log("warn", "Rejecting stanza with no 'to' address");
 			session.send(st.error_reply(stanza, "modify", "bad-request", "Components MUST specify a 'to' address on stanzas"));
 			return;
 		end

mercurial