diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-07-31 15:42:45 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-07-31 15:42:45 +0100 |
commit | 84f4ead3d22b612d0dbf21c78a73d91b6327be65 (patch) | |
tree | 7f75ebf16e94dba2150521af7cf25f5662c9c6c5 /util | |
parent | 03291219e4687c67615c7771c1b709eed73f5855 (diff) | |
download | prosody-84f4ead3d22b612d0dbf21c78a73d91b6327be65.tar.gz prosody-84f4ead3d22b612d0dbf21c78a73d91b6327be65.zip |
util.xmppstream: Explicitly release old parser object on stream reset
Diffstat (limited to 'util')
-rw-r--r-- | util/xmppstream.lua | 7 |
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; |