aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-31 22:25:48 +0200
committerKim Alvefur <zash@zash.se>2020-05-31 22:25:48 +0200
commitd22e85debcc0a230f82af5b07e28f4248f63e072 (patch)
tree4937f14d1382dddb1fe62e9ec3c8c8528ade3550 /plugins/mod_c2s.lua
parent836be9b60d1e2b10ec4cdfb3e58281f18c0a31d0 (diff)
downloadprosody-d22e85debcc0a230f82af5b07e28f4248f63e072.tar.gz
prosody-d22e85debcc0a230f82af5b07e28f4248f63e072.zip
mod_c2s,mod_s2s: Use a distinct stream error for hitting stanza size limit
Since this is not a real parse error, it should not be reported as such.
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 91e37c4a..c6a95e9e 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -308,7 +308,11 @@ function listener.onconnect(conn)
local ok, err = stream:feed(data);
if not ok then
log("debug", "Received invalid XML (%s) %d bytes: %q", err, #data, data:sub(1, 300));
- session:close("not-well-formed");
+ if err == "stanza-too-large" then
+ session:close({ condition = "policy-violation", text = "XML stanza is too big" });
+ else
+ session:close("not-well-formed");
+ end
end
end
end