Browse Source

Logs: show IPv6 address + port correctly

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

3
lib/jsonrpc.py

@ -177,6 +177,9 @@ 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'
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]) return '{}:{}'.format(self.peer_info[0], self.peer_info[1])
def connection_made(self, transport): def connection_made(self, transport):

Loading…
Cancel
Save