Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error_handler is fired when DNS resolution fails #1

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ sleekxmpp.egg-info/
*~
.baboon/
.DS_STORE
.idea/
5 changes: 5 additions & 0 deletions sleekxmpp/xmlstream/xmlstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,14 @@ def _connect(self, reattempt=True):
self._service_name = host
except StopIteration:
log.debug("No remaining DNS records to try.")
# When network connection is restored, DNS resolution still fails so error_handler is fired
log.debug("DNS error, firing error callback")
self.error_handler.fire()
self.dns_answers = None
if reattempt:
self.reconnect_delay = delay
if self.socket:
self.abort()
return False

af = Socket.AF_INET
Expand Down