[Pkg-privacy-commits] [onioncircuits] 06/62: Do not try to update a stream that doesn't belong to any circuit

Intrigeri intrigeri at moszumanska.debian.org
Thu Feb 18 20:20:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch master
in repository onioncircuits.

commit 6143fe3936a546669321033a7494ff11d974e08a
Author: Tails developers <tails at boum.org>
Date:   Tue Feb 17 03:25:09 2015 +0100

    Do not try to update a stream that doesn't belong to any circuit
---
 tormonitor | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tormonitor b/tormonitor
index aaa7c21..06e0ec0 100755
--- a/tormonitor
+++ b/tormonitor
@@ -273,13 +273,17 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
 
     def update_stream(self, stream):
         stream_iter = self._stream_to_iter[stream.id]
-        # If the stream changed circuit, reparent it
         if stream.circ_id != self._treestore.get_value(stream_iter, 1):
+            # The stream doesn't belong its parent circuit anymore. Remove it.
             self.remove_stream(stream)
-            stream_iter = self.add_stream(stream)
-        self._treestore.set(stream_iter, 2, self.stream_label(stream))
-        if stream.status:
-            self._treestore.set(stream_iter, 3, str(stream.status).lower())
+            if stream.circ_id:
+                # The stream has a new circuit, add it with its new parent.
+                stream_iter = self.add_stream(stream)
+        else:
+            # The stream didn't change parent. Update it.
+            self._treestore.set(stream_iter, 2, self.stream_label(stream))
+            if stream.status:
+                self._treestore.set(stream_iter, 3, str(stream.status).lower())
 
     def remove_stream(self, stream):
         self._treestore.remove(self._stream_to_iter[stream.id])

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncircuits.git



More information about the Pkg-privacy-commits mailing list