xmlstream: end the parser when the stream has ended

This commit is contained in:
mathieui 2021-01-24 21:43:49 +01:00
parent 456dff0b61
commit 571774edb4

View file

@ -431,6 +431,7 @@ class XMLStream(asyncio.BaseProtocol):
log.debug("End of stream received") log.debug("End of stream received")
self.disconnect_reason = "End of stream" self.disconnect_reason = "End of stream"
self.abort() self.abort()
return
elif self.xml_depth == 1: elif self.xml_depth == 1:
# A stanza is an XML element that is a direct child of # A stanza is an XML element that is a direct child of
# the root element, hence the check of depth == 1 # the root element, hence the check of depth == 1