summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-01-11 17:18:58 -0800
committerLance Stout <lancestout@gmail.com>2013-01-11 17:18:58 -0800
commitce977a78091189099b339363d4d856c443d29710 (patch)
tree408b51e94d21b932c6184ca509ce77a235a4dd53
parent7b45245b1dd557b9dea98fdcce96d1f8f2a2771d (diff)
downloadslixmpp-ce977a78091189099b339363d4d856c443d29710.tar.gz
slixmpp-ce977a78091189099b339363d4d856c443d29710.tar.bz2
slixmpp-ce977a78091189099b339363d4d856c443d29710.tar.xz
slixmpp-ce977a78091189099b339363d4d856c443d29710.zip
Don't reset exponential backoff delay until a stream has been confirmed.
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 7955fee5..3f87df52 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -560,7 +560,6 @@ class XMLStream(object):
self.set_socket(self.socket, ignore=True)
#this event is where you should set your application state
self.event("connected", direct=True)
- self.reconnect_delay = 1.0
return True
except (Socket.error, ssl.SSLError) as serr:
error_msg = "Could not connect to %s:%s. Socket Error #%s: %s"
@@ -1493,6 +1492,10 @@ class XMLStream(object):
# as handshakes.
self.stream_end_event.clear()
self.start_stream_handler(root)
+
+ # We have a successful stream connection, so reset
+ # exponential backoff for new reconnect attempts.
+ self.reconnect_delay = 1.0
depth += 1
if event == b'end':
depth -= 1