commit 4a307329553e0039d4b8f80bcfa150e605d68863 Author: Damian Johnson atagar@torproject.org Date: Sat Jun 28 13:18:13 2014 -0700
Dropping unnecessary address value from header
We were tracking our address and or_address but the former was simply used as a default if the former was unset. Might as well simplify this, and drop the pointless GETINFO query if we don't need it. --- arm/header_panel.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/arm/header_panel.py b/arm/header_panel.py index 0d1f0bd..bc0484b 100644 --- a/arm/header_panel.py +++ b/arm/header_panel.py @@ -185,18 +185,11 @@ class HeaderPanel(panel.Panel, threading.Thread): x, include_control_port = 0, True
if vals.or_port: - my_address = 'Unknown' - - if vals.or_address: - my_address = vals.or_address - elif vals.address: - my_address = vals.address - # acting as a relay (we can assume certain parameters are set
dir_port_label = ', Dir Port: %s' % vals.dir_port if vals.dir_port != '0' else ''
- for label in (vals.nickname, ' - ' + my_address, ':%s' % vals.or_port, dir_port_label): + for label in (vals.nickname, ' - ' + vals.or_address, ':%s' % vals.or_port, dir_port_label): if x + len(label) <= left_width: self.addstr(1, x, label) x += len(label) @@ -502,10 +495,9 @@ class Sampling(object): self.retrieved = time.time() self.arm_total_cpu_time = sum(os.times()[:3])
- self.address = controller.get_info('address', '') self.fingerprint = controller.get_info('fingerprint', 'Unknown') self.nickname = controller.get_conf('Nickname', '') - self.or_address = or_listeners[0][0] if or_listeners else '' + self.or_address = or_listeners[0][0] if or_listeners else controller.get_info('address', 'Unknown') self.or_port = or_listeners[0][1] if or_listeners else '' self.dir_port = controller.get_conf('DirPort', '0')
tor-commits@lists.torproject.org