summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-08-14 09:54:38 -0700
committerLance Stout <lancestout@gmail.com>2012-08-14 09:54:38 -0700
commitc6ac64ed2dc4b7a3562d15d030ce3b7f76f941dc (patch)
tree76e1eba5c635e81c276e0149b1e77f3f0a72e23b
parent92be0514504747811af0b4f160fe8f2b63bf454d (diff)
downloadslixmpp-c6ac64ed2dc4b7a3562d15d030ce3b7f76f941dc.tar.gz
slixmpp-c6ac64ed2dc4b7a3562d15d030ce3b7f76f941dc.tar.bz2
slixmpp-c6ac64ed2dc4b7a3562d15d030ce3b7f76f941dc.tar.xz
slixmpp-c6ac64ed2dc4b7a3562d15d030ce3b7f76f941dc.zip
Help prevent race condition dealing with auto_reconnect
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index f56c360e..df06d067 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -678,6 +678,9 @@ class XMLStream(object):
args=(reconnect, wait, send_close))
def _disconnect(self, reconnect=False, wait=None, send_close=True):
+ if not reconnect:
+ self.auto_reconnect = False
+
if self.end_session_on_disconnect or send_close:
self.event('session_end', direct=True)
@@ -697,9 +700,6 @@ class XMLStream(object):
if send_close:
self.send_raw(self.stream_footer, now=True)
- if not reconnect:
- self.auto_reconnect = False
-
# Wait for confirmation that the stream was
# closed in the other direction. If we didn't
# send a stream footer we don't need to wait