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

[or-cvs] r16352: Woops, can't very well ask Dan to run broken code. Fix weird (torctl/trunk/python/TorCtl)



Author: mikeperry
Date: 2008-08-01 21:55:57 -0400 (Fri, 01 Aug 2008)
New Revision: 16352

Modified:
   torctl/trunk/python/TorCtl/PathSupport.py
Log:

Woops, can't very well ask Dan to run broken code. Fix
weirdness with DNS resolution stream events that probably
showed up in 0.2.0.x.



Modified: torctl/trunk/python/TorCtl/PathSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/PathSupport.py	2008-08-02 01:45:12 UTC (rev 16351)
+++ torctl/trunk/python/TorCtl/PathSupport.py	2008-08-02 01:55:57 UTC (rev 16352)
@@ -1148,13 +1148,14 @@
     if s.status == "NEW" or s.status == "NEWRESOLVE":
       if s.status == "NEWRESOLVE" and not s.target_port:
         s.target_port = self.resolve_port
-      self.streams[s.strm_id] = Stream(s.strm_id, s.target_host, s.target_port, s.status)
+      if s.circ_id == 0:
+        self.streams[s.strm_id] = Stream(s.strm_id, s.target_host, s.target_port, s.status)
       # Remember Tor-handled streams (Currently only directory streams)
       if s.purpose and s.purpose.find("DIR_") == 0:
         self.streams[s.strm_id].ignored = True
         plog("DEBUG", "Ignoring stream: " + str(s.strm_id))
         return
-      else:
+      elif s.circ_id == 0:
         self.attach_stream_any(self.streams[s.strm_id],
                    self.streams[s.strm_id].detached_from)
     elif s.status == "DETACHED":
@@ -1458,14 +1459,15 @@
       if s.status == "NEWRESOLVE" and not s.target_port:
         s.target_port = self.resolve_port      
       # Set up the new stream
-      stream = Stream(s.strm_id, s.target_host, s.target_port, s.status)
-
-      self.streams[s.strm_id] = stream
+      if s.circ_id == 0:
+        stream = Stream(s.strm_id, s.target_host, s.target_port, s.status)
+        self.streams[s.strm_id] = stream
+      
       if s.purpose and s.purpose.find("DIR_") == 0:
         stream.ignored = True
         plog("DEBUG", "Ignoring stream: " + str(s.strm_id))
         return
-      else:
+      elif s.circ_id == 0:
         self.attach_stream_any(self.streams[s.strm_id], self.streams[s.strm_id].detached_from)
     
     # DETACHED