aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;