aboutsummaryrefslogtreecommitdiffstats
path: root/util/xmppstream.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-07-31 15:42:45 +0100
committerMatthew Wild <mwild1@gmail.com>2018-07-31 15:42:45 +0100
commit84f4ead3d22b612d0dbf21c78a73d91b6327be65 (patch)
tree7f75ebf16e94dba2150521af7cf25f5662c9c6c5 /util/xmppstream.lua
parent03291219e4687c67615c7771c1b709eed73f5855 (diff)
downloadprosody-84f4ead3d22b612d0dbf21c78a73d91b6327be65.tar.gz
prosody-84f4ead3d22b612d0dbf21c78a73d91b6327be65.zip
util.xmppstream: Explicitly release old parser object on stream reset
Diffstat (limited to 'util/xmppstream.lua')
-rw-r--r--util/xmppstream.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/xmppstream.lua b/util/xmppstream.lua
index f245afbf..58cbd18e 100644
--- a/util/xmppstream.lua
+++ b/util/xmppstream.lua
@@ -278,10 +278,15 @@ local function new(session, stream_callbacks, stanza_size_limit)
if lxp_supports_bytecount then
n_outstanding_bytes = n_outstanding_bytes + #data;
end
- local ok, err = parse(parser, data);
+ local _parser = parser;
+ local ok, err = parse(_parser, data);
if lxp_supports_bytecount and n_outstanding_bytes > stanza_size_limit then
return nil, "stanza-too-large";
end
+ if parser ~= _parser then
+ _parser:parse();
+ _parser:close();
+ end
return ok, err;
end,
set_session = meta.set_session;