Software /
code /
prosody
Comparison
util/xmppstream.lua @ 9071:db61e33bbd41
util.xmppstream: Explicitly release old parser object on stream reset
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 31 Jul 2018 15:42:45 +0100 |
parent | 9020:19e51d8f8947 |
child | 10093:1266a63ba567 |
child | 11543:63fd4c8465fb |
comparison
equal
deleted
inserted
replaced
9070:21730a3642fe | 9071:db61e33bbd41 |
---|---|
276 end, | 276 end, |
277 feed = function (self, data) -- luacheck: ignore 212/self | 277 feed = function (self, data) -- luacheck: ignore 212/self |
278 if lxp_supports_bytecount then | 278 if lxp_supports_bytecount then |
279 n_outstanding_bytes = n_outstanding_bytes + #data; | 279 n_outstanding_bytes = n_outstanding_bytes + #data; |
280 end | 280 end |
281 local ok, err = parse(parser, data); | 281 local _parser = parser; |
282 local ok, err = parse(_parser, data); | |
282 if lxp_supports_bytecount and n_outstanding_bytes > stanza_size_limit then | 283 if lxp_supports_bytecount and n_outstanding_bytes > stanza_size_limit then |
283 return nil, "stanza-too-large"; | 284 return nil, "stanza-too-large"; |
285 end | |
286 if parser ~= _parser then | |
287 _parser:parse(); | |
288 _parser:close(); | |
284 end | 289 end |
285 return ok, err; | 290 return ok, err; |
286 end, | 291 end, |
287 set_session = meta.set_session; | 292 set_session = meta.set_session; |
288 }; | 293 }; |