Software /
code /
prosody
Comparison
plugins/mod_s2s.lua @ 11770:d2a9aa1c7ac8
mod_c2s,mod_s2s: Indicate stanza size violation with condition from XEP-0205 (thanks mjk)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 06 Sep 2021 23:21:25 +0200 |
parent | 11742:9c450185bac1 |
child | 11772:e2155e2703dd |
comparison
equal
deleted
inserted
replaced
11769:071715a18394 | 11770:d2a9aa1c7ac8 |
---|---|
744 if data then | 744 if data then |
745 local ok, err = stream:feed(data); | 745 local ok, err = stream:feed(data); |
746 if ok then return; end | 746 if ok then return; end |
747 log("debug", "Received invalid XML (%s) %d bytes: %q", err, #data, data:sub(1, 300)); | 747 log("debug", "Received invalid XML (%s) %d bytes: %q", err, #data, data:sub(1, 300)); |
748 if err == "stanza-too-large" then | 748 if err == "stanza-too-large" then |
749 session:close({ condition = "policy-violation", text = "XML stanza is too big" }, nil, "Received invalid XML from remote server"); | 749 session:close({ |
750 condition = "policy-violation", | |
751 text = "XML stanza is too big", | |
752 extra = st.stanza("stanza-too-big", { xmlns = 'urn:xmpp:errors' }), | |
753 }, nil, "Received invalid XML from remote server"); | |
750 else | 754 else |
751 session:close("not-well-formed", nil, "Received invalid XML from remote server"); | 755 session:close("not-well-formed", nil, "Received invalid XML from remote server"); |
752 end | 756 end |
753 end | 757 end |
754 end | 758 end |