From da6e1e47dc81f5f9579201644d7c18dd85510368 Mon Sep 17 00:00:00 2001 From: Thom Nichols Date: Thu, 3 Jun 2010 08:09:09 -0400 Subject: whups, somehow I lost the 'connecting' lock in connect() --- sleekxmpp/xmlstream/xmlstream.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sleekxmpp') 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 -- cgit v1.2.3