From c372bd516862781f372fef352508d429620c418c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 16 Feb 2017 11:27:36 +0000 Subject: xmlstream: Warn when the parser is None when data is received. --- slixmpp/xmlstream/xmlstream.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 0b5a55e1..8daf99e4 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -358,6 +358,10 @@ class XMLStream(asyncio.BaseProtocol): event. This could trigger one or more event (a stanza is received, the stream is opened, etc). """ + if self.parser is None: + log.warning('Received data before the connection is established: %r', + data) + return self.parser.feed(data) try: for event, xml in self.parser.read_events(): -- cgit v1.2.3