Browse Source

Logs: show IPv6 address + port correctly

Closes #79
master
Neil Booth 8 years ago
parent
commit
378372e666
  1. 5
      lib/jsonrpc.py

5
lib/jsonrpc.py

@ -177,7 +177,10 @@ class JSONRPC(asyncio.Protocol, LoggedClass):
return 'unknown' return 'unknown'
if for_log and self.anon_logs: if for_log and self.anon_logs:
return 'xx.xx.xx.xx:xx' return 'xx.xx.xx.xx:xx'
return '{}:{}'.format(self.peer_info[0], self.peer_info[1]) if ':' in self.peer_info[0]:
return '[{}]:{}'.format(self.peer_info[0], self.peer_info[1])
else:
return '{}:{}'.format(self.peer_info[0], self.peer_info[1])
def connection_made(self, transport): def connection_made(self, transport):
'''Handle an incoming client connection.''' '''Handle an incoming client connection.'''

Loading…
Cancel
Save