Browse Source

get_extra_info fix

master 0.11.4
Neil Booth 8 years ago
parent
commit
23b7ec3fb5
  1. 5
      lib/jsonrpc.py

5
lib/jsonrpc.py

@ -760,8 +760,10 @@ class JSONSession(JSONSessionBase, asyncio.Protocol):
def peer_info(self):
'''Returns information about the peer.'''
if self.transport:
try:
# get_extra_info can throw even if self.transport is not None
return self.transport.get_extra_info('peername')
except Exception:
return None
def abort(self):
@ -776,7 +778,6 @@ class JSONSession(JSONSessionBase, asyncio.Protocol):
def connection_lost(self, exc):
'''Trigger timeouts of all pending requests.'''
self.transport = None
self.timeout_session()
def is_closing(self):

Loading…
Cancel
Save