aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2011-01-29 04:54:08 +0500
committerWaqas Hussain <waqas20@gmail.com>2011-01-29 04:54:08 +0500
commitd76f04e84ecd78b6b9b0e2e354d51a847491fea4 (patch)
treebdd1dfe8c1990036e76b8cffc9db2dface0458ac /core
parent3dda2fcfac6774f42c10338bfc2362ad666b9c5b (diff)
parent4e486d4ba9300c553a7a8fce15037141d48a77f5 (diff)
downloadprosody-d76f04e84ecd78b6b9b0e2e354d51a847491fea4.tar.gz
prosody-d76f04e84ecd78b6b9b0e2e354d51a847491fea4.zip
Merge 0.8->trunk
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua3
-rw-r--r--core/stanza_router.lua5
2 files changed, 5 insertions, 3 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index df201e9e..0fb055cb 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -76,7 +76,8 @@ local function bounce_sendq(session, reason)
reply:tag("error", {type = "cancel"})
:tag("remote-server-not-found", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}):up();
if reason then
- reply:tag("text", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}):text("Connection failed: "..reason):up();
+ reply:tag("text", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"})
+ :text("Server-to-server connection failed: "..reason):up();
end
core_process_stanza(dummy, reply);
end
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 97d328a1..406ad2f0 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -40,6 +40,7 @@ local function handle_unhandled_stanza(host, origin, stanza)
end
end
+local iq_types = { set=true, get=true, result=true, error=true };
function core_process_stanza(origin, stanza)
(origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag())
@@ -47,8 +48,8 @@ function core_process_stanza(origin, stanza)
if stanza.attr.type == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log
if stanza.name == "iq" then
if not stanza.attr.id then stanza.attr.id = ""; end -- COMPAT Jabiru doesn't send the id attribute on roster requests
- if (stanza.attr.type == "set" or stanza.attr.type == "get") and (#stanza.tags ~= 1) then
- origin.send(st.error_reply(stanza, "modify", "bad-request"));
+ if not iq_types[stanza.attr.type] or ((stanza.attr.type == "set" or stanza.attr.type == "get") and (#stanza.tags ~= 1)) then
+ origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type or incorrect number of children"));
return;
end
end