summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-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 ad2c5a1c..e5d5f583 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -194,8 +194,11 @@ class XMLStream(object):
except KeyboardInterrupt:
logging.debug("Keyboard Escape Detected")
self.state.set('processing', False)
+ self.state.set('reconnect', False)
self.disconnect()
raise
+ except CloseStream:
+ break
except:
self.state.set('processing', False)
traceback.print_exc()
@@ -263,7 +266,7 @@ class XMLStream(object):
except socket.error,(errno,strerror):
logging.warning("Error while disconnecting. Socket Error #%s: %s" % (errno, strerror))
if self.state['processing']:
- raise
+ raise CloseStream
def reconnect(self):
self.state.set('tls',False)