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

get(addr|name)info API adjustments for pyuv 1.1 and more explicit exception logging #17

Merged
merged 2 commits into from
Jun 18, 2015
Merged
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
6 changes: 3 additions & 3 deletions gruvi/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def getaddrinfo(node, service=0, family=0, socktype=0, protocol=0, flags=0, time
"""
hub = get_hub()
with switch_back(timeout) as switcher:
request = pyuv.dns.getaddrinfo(hub.loop, switcher, node, service, family,
socktype, protocol, flags)
request = pyuv.dns.getaddrinfo(hub.loop, node, service, family,
socktype, protocol, flags, callback=switcher)
switcher.add_cleanup(request.cancel)
result = hub.switch()
result, error = result[0]
Expand All @@ -94,7 +94,7 @@ def getnameinfo(sockaddr, flags=0, timeout=30):
"""
hub = get_hub()
with switch_back(timeout) as switcher:
request = pyuv.dns.getnameinfo(hub.loop, switcher, sockaddr, flags)
request = pyuv.dns.getnameinfo(hub.loop, sockaddr, flags, callback=switcher)
switcher.add_cleanup(request.cancel)
result = hub.switch()
result, error = result[0]
Expand Down
5 changes: 2 additions & 3 deletions gruvi/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _process_write_backlog(self):
del self._write_backlog[0]
self._write_buffer_size -= offset
except ssl.SSLError as e:
self._log.warning('SSL error {} (reason {})', e.errno, e.reason)
self._log.warning('SSL error {} (reason {})', e.errno, e.reason, exc_info=True)
self._error = e
self.abort()

Expand Down Expand Up @@ -378,8 +378,7 @@ def _read_callback(self, handle, data, error):
self.close()
except ssl.SSLError as e:
self._log.warning('SSL error {} (reason {})', e.errno,
getattr(e, 'reason', 'unknown'))
print(repr(e))
getattr(e, 'reason', 'unknown'), exc_info=True)
self._error = e
self.abort()
# Process write backlog. A read could have unblocked a write.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cffi >= 0.8
fibers >= 0.4
pyuv >= 1.0
pyuv >= 1.1
six