# HG changeset patch # User Waqas Hussain # Date 1226585671 -18000 # Node ID 9f66ede8deeb26e9f3d6cbceda588a5a4c90982a # Parent 1fc47cf5d14494b89b6faca5e21c57ba0b8560d9 Added error replies for unhandled stanzas diff -r 1fc47cf5d144 -r 9f66ede8deeb core/stanza_router.lua --- a/core/stanza_router.lua Thu Nov 13 12:13:13 2008 +0500 +++ b/core/stanza_router.lua Thu Nov 13 19:14:31 2008 +0500 @@ -173,11 +173,16 @@ end stanza.attr.to = nil; -- reset it else - -- TODO error, bad type + log("warn", "Unhandled c2s presence: %s", tostring(stanza)); + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? end + else + log("warn", "Unhandled c2s stanza: %s", tostring(stanza)); + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? end -- TODO handle other stanzas else - log("warn", "Unhandled origin: %s", origin.type); -- FIXME reply with error + log("warn", "Unhandled origin: %s", origin.type); + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? end end