[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [pytorctl/master] Handle Tor bug #1525: allow new streams to have a non-zero circ id.



Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Mon, 7 Jun 2010 14:54:39 -0700
Subject: Handle Tor bug #1525: allow new streams to have a non-zero circ id.
Commit: ff4373fbce9e4283070363d6bb6e034b296c4a58

---
 PathSupport.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/PathSupport.py b/PathSupport.py
index 107c0d9..395c773 100644
--- a/PathSupport.py
+++ b/PathSupport.py
@@ -1664,6 +1664,12 @@ class PathBuilder(TorCtl.ConsensusTracker):
         s.target_port = self.resolve_port
       if s.circ_id == 0:
         self.streams[s.strm_id] = Stream(s.strm_id, s.target_host, s.target_port, s.status)
+      elif s.strm_id not in self.streams:
+        plog("NOTICE", "Got new stream "+str(s.strm_id)+" with circuit "
+                       +str(s.circ_id)+" already attached.")
+        self.streams[s.strm_id] = Stream(s.strm_id, s.target_host, s.target_port, s.status)
+        self.streams[s.strm_id].circ_id = s.circ_id
+
       # Remember Tor-handled streams (Currently only directory streams)
 
       if s.purpose and s.purpose.find("DIR_") == 0:
-- 
1.6.5