diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-14 18:46:00 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-14 18:46:00 +0000 |
commit | 50e328e87fb21ffca2780128ed5da9c0e011eb5f (patch) | |
tree | ecaab6e5000d22deb6b78c52d554b97c8a2f956e /core | |
parent | 44701835b153e9497a8a5f634ece17ffda41c5ca (diff) | |
download | prosody-50e328e87fb21ffca2780128ed5da9c0e011eb5f.tar.gz prosody-50e328e87fb21ffca2780128ed5da9c0e011eb5f.zip |
Only reply with errors if the stanza is not an error or a result (don't know how much bandwidth this just cost me :) )
Diffstat (limited to 'core')
-rw-r--r-- | core/stanza_router.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 16e6598f..c1819651 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -174,16 +174,22 @@ function core_handle_stanza(origin, stanza) stanza.attr.to = nil; -- reset it else log("warn", "Unhandled c2s presence: %s", tostring(stanza)); - origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? + if stanza.attr.type ~= "error" then + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? + end end else log("warn", "Unhandled c2s stanza: %s", tostring(stanza)); - origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? + if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? + end end -- TODO handle other stanzas else log("warn", "Unhandled origin: %s", origin.type); - -- s2s stanzas can get here - (origin.sends2s or origin.send)(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? + if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then + -- s2s stanzas can get here + (origin.sends2s or origin.send)(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? + end end end |