Changeset

3321:dcdfc04f9e3a

xmppcomponent_listener: Add log messages for when stanzas from components have invalid or missing to/from addresses
author Matthew Wild <mwild1@gmail.com>
date Sun, 04 Jul 2010 19:16:20 +0100
parents 3320:517ae40a12a2
children 3322:c4e107e7c883
files net/xmppcomponent_listener.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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