diff options
author | Thom Nichols <tmnichols@gmail.com> | 2010-06-03 08:09:09 -0400 |
---|---|---|
committer | Thom Nichols <tmnichols@gmail.com> | 2010-06-03 08:09:09 -0400 |
commit | da6e1e47dc81f5f9579201644d7c18dd85510368 (patch) | |
tree | 2c6a8519d43d2a1f482e14d7c5a4df55a8e75fd0 /sleekxmpp/xmlstream | |
parent | 2f0f18a8c62db21fa3ba8cc87a6d190aca205c30 (diff) | |
download | slixmpp-da6e1e47dc81f5f9579201644d7c18dd85510368.tar.gz slixmpp-da6e1e47dc81f5f9579201644d7c18dd85510368.tar.bz2 slixmpp-da6e1e47dc81f5f9579201644d7c18dd85510368.tar.xz slixmpp-da6e1e47dc81f5f9579201644d7c18dd85510368.zip |
whups, somehow I lost the 'connecting' lock in connect()
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index af95c2bf..76aecee4 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -101,6 +101,10 @@ class XMLStream(object): def connect(self, host='', port=0, use_ssl=None, use_tls=None): "Link to connectTCP" + if not self.state.transition('disconnected','connecting'): + logging.warning("Can't connect now; Already in state %s", self.state.current_state()) + return False + if not self.connectTCP(host, port, use_ssl, use_tls): # return to the 'disconnected' state if connect failed: # otherwise the connect method is not reentrant |