diff options
-rw-r--r-- | doc/doap.xml | 7 | ||||
-rw-r--r-- | plugins/mod_c2s.lua | 6 | ||||
-rw-r--r-- | plugins/mod_s2s.lua | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/doc/doap.xml b/doc/doap.xml index 34a696b4..b2863b19 100644 --- a/doc/doap.xml +++ b/doc/doap.xml @@ -446,6 +446,13 @@ </implements> <implements> <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0205.html"/> + <xmpp:since>0.12.0</xmpp:since> + <xmpp:note>stanza size limits, bandwidth limits, stanza-too-big error condition</xmpp:note> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0206.html"/> <xmpp:version>1.2</xmpp:version> <xmpp:since>0.2.0</xmpp:since> diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 8bd28782..1f22d871 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -339,7 +339,11 @@ function listener.onconnect(conn) if not ok then log("debug", "Received invalid XML (%s) %d bytes: %q", err, #data, data:sub(1, 300)); if err == "stanza-too-large" then - session:close({ condition = "policy-violation", text = "XML stanza is too big" }); + session:close({ + condition = "policy-violation", + text = "XML stanza is too big", + extra = st.stanza("stanza-too-big", { xmlns = 'urn:xmpp:errors' }), + }); else session:close("not-well-formed"); end diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index d800138f..cc935d21 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -746,7 +746,11 @@ local function initialize_session(session) if ok then return; end log("debug", "Received invalid XML (%s) %d bytes: %q", err, #data, data:sub(1, 300)); if err == "stanza-too-large" then - session:close({ condition = "policy-violation", text = "XML stanza is too big" }, nil, "Received invalid XML from remote server"); + session:close({ + condition = "policy-violation", + text = "XML stanza is too big", + extra = st.stanza("stanza-too-big", { xmlns = 'urn:xmpp:errors' }), + }, nil, "Received invalid XML from remote server"); else session:close("not-well-formed", nil, "Received invalid XML from remote server"); end |