aboutsummaryrefslogtreecommitdiffstats
path: root/util/xmppstream.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2021-05-13 11:17:13 +0100
committerMatthew Wild <mwild1@gmail.com>2021-05-13 11:17:13 +0100
commit5bc8b2a379e21901429e4d7f5e10e424ca85e403 (patch)
treedc46f3423a4319e09fe85402fa76f15568ad89d1 /util/xmppstream.lua
parent37ad3b8fb2039684273b3cb63b5b573e879b04d7 (diff)
parenta95576d485eda2a273b4d66c4c2b363f88c5c43a (diff)
downloadprosody-5bc8b2a379e21901429e4d7f5e10e424ca85e403.tar.gz
prosody-5bc8b2a379e21901429e4d7f5e10e424ca85e403.zip
Merge 0.11->trunk
Diffstat (limited to 'util/xmppstream.lua')
-rw-r--r--util/xmppstream.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/xmppstream.lua b/util/xmppstream.lua
index 2763b000..be113396 100644
--- a/util/xmppstream.lua
+++ b/util/xmppstream.lua
@@ -22,7 +22,7 @@ local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false });
local lxp_supports_xmldecl = pcall(lxp.new, { XmlDecl = false });
local lxp_supports_bytecount = not not lxp.new({}).getcurrentbytecount;
-local default_stanza_size_limit = 1024*1024*10; -- 10MB
+local default_stanza_size_limit = 1024*1024*1; -- 1MB
local _ENV = nil;
-- luacheck: std none
@@ -194,6 +194,9 @@ local function new_sax_handlers(session, stream_callbacks, cb_handleprogress)
stanza = t_remove(stack);
end
else
+ if lxp_supports_bytecount then
+ cb_handleprogress(stanza_size);
+ end
if cb_streamclosed then
cb_streamclosed(session);
end
@@ -295,6 +298,9 @@ local function new(session, stream_callbacks, stanza_size_limit)
return ok, err;
end,
set_session = meta.set_session;
+ set_stanza_size_limit = function (_, new_stanza_size_limit)
+ stanza_size_limit = new_stanza_size_limit;
+ end;
};
end