Software /
code /
prosody
Comparison
util/xmppstream.lua @ 11560:3bbb1af92514
Merge 0.11->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 13 May 2021 11:17:13 +0100 |
parent | 11516:83822be7704d |
parent | 11547:dd21eb632f52 |
child | 12975:d10957394a3c |
comparison
equal
deleted
inserted
replaced
11538:30feeb4d9d0b | 11560:3bbb1af92514 |
---|---|
20 -- COMPAT: w/LuaExpat 1.1.0 | 20 -- COMPAT: w/LuaExpat 1.1.0 |
21 local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false }); | 21 local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false }); |
22 local lxp_supports_xmldecl = pcall(lxp.new, { XmlDecl = false }); | 22 local lxp_supports_xmldecl = pcall(lxp.new, { XmlDecl = false }); |
23 local lxp_supports_bytecount = not not lxp.new({}).getcurrentbytecount; | 23 local lxp_supports_bytecount = not not lxp.new({}).getcurrentbytecount; |
24 | 24 |
25 local default_stanza_size_limit = 1024*1024*10; -- 10MB | 25 local default_stanza_size_limit = 1024*1024*1; -- 1MB |
26 | 26 |
27 local _ENV = nil; | 27 local _ENV = nil; |
28 -- luacheck: std none | 28 -- luacheck: std none |
29 | 29 |
30 local new_parser = lxp.new; | 30 local new_parser = lxp.new; |
192 stanza = nil; | 192 stanza = nil; |
193 else | 193 else |
194 stanza = t_remove(stack); | 194 stanza = t_remove(stack); |
195 end | 195 end |
196 else | 196 else |
197 if lxp_supports_bytecount then | |
198 cb_handleprogress(stanza_size); | |
199 end | |
197 if cb_streamclosed then | 200 if cb_streamclosed then |
198 cb_streamclosed(session); | 201 cb_streamclosed(session); |
199 end | 202 end |
200 end | 203 end |
201 end | 204 end |
293 _parser:close(); | 296 _parser:close(); |
294 end | 297 end |
295 return ok, err; | 298 return ok, err; |
296 end, | 299 end, |
297 set_session = meta.set_session; | 300 set_session = meta.set_session; |
301 set_stanza_size_limit = function (_, new_stanza_size_limit) | |
302 stanza_size_limit = new_stanza_size_limit; | |
303 end; | |
298 }; | 304 }; |
299 end | 305 end |
300 | 306 |
301 return { | 307 return { |
302 ns_separator = ns_separator; | 308 ns_separator = ns_separator; |