summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan <alan@boum.org>2016-02-18 20:41:18 +0000
committerAlan <alan@boum.org>2016-02-18 20:41:18 +0000
commite7722ecc92f0248e123ce918af2f9c02065f2cb6 (patch)
treef089a354998a85b1edcd5258d9a7059e6f5b85d2
parent44d6f81561c60ff8105af59a55814e85e3d511bc (diff)
If a circuit is closed twice, dont readd it
With bad network conditions, stem sometimes sends the circuit closed event twice. When recieving the 2nd of these events, Tor Monitor used to add the circuit that had beeen removed from the list by the 1st. Will-fix: 10517
-rwxr-xr-xtor-monitor9
1 files changed, 6 insertions, 3 deletions
diff --git a/tor-monitor b/tor-monitor
index 9abb957..a7b7c10 100755
--- a/tor-monitor
+++ b/tor-monitor
@@ -367,12 +367,15 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
:var stem.response.events.CircuitEvent circ_event: the circuit event
"""
+ circ_is_closed = circ_event.status in [stem.CircStatus.FAILED,
+ stem.CircStatus.CLOSED]
+
if circ_event.id not in self._circ_to_iter:
- self.add_circuit(circ_event)
+ if not circ_is_closed:
+ self.add_circuit(circ_event)
else:
self.update_circuit(circ_event)
- if (circ_event.status == stem.CircStatus.FAILED
- or circ_event.status == stem.CircStatus.CLOSED):
+ if circ_is_closed:
self.remove_circuit_delayed(circ_event)
# Streams