From bcb90a653eef0564a7a6d604b1f7ec809a777520 Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Tue, 26 Mar 2019 11:02:28 +0100 Subject: Do not close stream on 0-timeout disconnect, allows 0198 resume --- slixmpp/xmlstream/xmlstream.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 9e407d7e..1fe52cee 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -467,8 +467,8 @@ class XMLStream(asyncio.BaseProtocol): at most `wait` seconds. After the given number of seconds has passed without a response from the serveur, or when the server successfully responds with a closure of its own stream, abort() is - called. If wait is 0.0, this is almost equivalent to calling abort() - directly. + called. If wait is 0.0, this will call abort() directly without closing + the stream. Does nothing if we are not connected. @@ -478,7 +478,8 @@ class XMLStream(asyncio.BaseProtocol): self.disconnect_reason = reason self.cancel_connection_attempt() if self.transport: - self.send_raw(self.stream_footer) + if wait > 0.0: + self.send_raw(self.stream_footer) self.schedule('Disconnect wait', wait, self.abort, repeat=False) -- cgit v1.2.3