diff options
author | Lance Stout <lancestout@gmail.com> | 2012-02-10 19:20:17 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-02-10 19:20:17 -0800 |
commit | e76d6a481f3ab30d61ce808c79ae9d8088582ca8 (patch) | |
tree | 8ff7054a07ecaf789ac02cf1711f33364632481e | |
parent | c1357717d952999a0aca7d96bf15d72ada01e75b (diff) | |
download | slixmpp-e76d6a481f3ab30d61ce808c79ae9d8088582ca8.tar.gz slixmpp-e76d6a481f3ab30d61ce808c79ae9d8088582ca8.tar.bz2 slixmpp-e76d6a481f3ab30d61ce808c79ae9d8088582ca8.tar.xz slixmpp-e76d6a481f3ab30d61ce808c79ae9d8088582ca8.zip |
Fix undefined variable references when DNS timeouts.
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index a6ea53f9..d571c0fa 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -412,7 +412,8 @@ class XMLStream(object): except Socket.error: log.debug("Could not open IPv%s socket." % proto) except Socket.gaierror: - log.warning("Socket could not be opened, wrong IP versions.") + log.warning("Socket could not be opened: no connectivity" + \ + " or wrong IP versions.") self.stop.set() return False @@ -923,6 +924,7 @@ class XMLStream(object): items = [x for x in addresses.keys()] items.sort() + address = (domain, port) picked = random.randint(0, intmax) for item in items: if picked <= item: @@ -930,8 +932,8 @@ class XMLStream(object): break for idx, answer in enumerate(self.dns_answers): if self.dns_answers[0] == address: + self.dns_answers.pop(idx) break - self.dns_answers.pop(idx) log.debug("Trying to connect to %s:%s", *address) return address |