Permalink
Browse files

Prevent auto_reconnect interference when disconnecting.

  • Loading branch information...
1 parent 2324c90 commit 80a90a6221733d0985f0d585b3abbd1d8fab70b0 @legastero legastero committed Aug 5, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 sleekxmpp/xmlstream/xmlstream.py
View
4 sleekxmpp/xmlstream/xmlstream.py
@@ -692,11 +692,13 @@ def _disconnect(self, reconnect=False, wait=None, send_close=True):
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
# since the server won't know to respond.
- self.auto_reconnect = reconnect
if send_close:
log.info('Waiting for %s from server', self.stream_footer)
self.stream_end_event.wait(4)

0 comments on commit 80a90a6

Please sign in to comment.