summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-09-18 10:35:53 -0700
committerLance Stout <lancestout@gmail.com>2012-09-18 10:35:53 -0700
commitc2ae1ee8910a60902ec4aa709ef7c26376eede47 (patch)
treeda3a1159e3cf3114e81dd25c1c0553ada2d1c640
parentfb3e6b7e35bb949f73a756ae5be683e2fec12454 (diff)
downloadslixmpp-c2ae1ee8910a60902ec4aa709ef7c26376eede47.tar.gz
slixmpp-c2ae1ee8910a60902ec4aa709ef7c26376eede47.tar.bz2
slixmpp-c2ae1ee8910a60902ec4aa709ef7c26376eede47.tar.xz
slixmpp-c2ae1ee8910a60902ec4aa709ef7c26376eede47.zip
Remove race condition when aborting while connecting/reconnecting.
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 246bc205..a58b63d4 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -420,6 +420,8 @@ class XMLStream(object):
:param reattempt: Flag indicating if the socket should reconnect
after disconnections.
"""
+ self.stop.clear()
+
if host and port:
self.address = (host, int(port))
try:
@@ -452,7 +454,6 @@ class XMLStream(object):
def _connect(self, reattempt=True):
self.scheduler.remove('Session timeout check')
- self.stop.clear()
if self.reconnect_delay is None or not reattempt:
delay = 1.0