[or-cvs] r15683: remove some cruft (blossom/trunk)

goodell at seul.org goodell at seul.org
Sun Jul 6 00:43:05 UTC 2008


Author: goodell
Date: 2008-07-05 20:43:05 -0400 (Sat, 05 Jul 2008)
New Revision: 15683

Modified:
   blossom/trunk/blossom.py
Log:
remove some cruft


Modified: blossom/trunk/blossom.py
===================================================================
--- blossom/trunk/blossom.py	2008-07-05 22:57:25 UTC (rev 15682)
+++ blossom/trunk/blossom.py	2008-07-06 00:43:05 UTC (rev 15683)
@@ -1351,7 +1351,7 @@
 
     if persist_nickname.has_key(b):
         try:
-            log_msg(2, "*** establishing persistent connection: %s" % b)
+            log_msg(2, "*** establishing persistent connection: %s" % persist_nickname[b])
             ret = conn.extend_circuit(0, [persist_nickname[b]])
             persist_id[ret] = b
             if unestablished.has_key(b):
@@ -1595,7 +1595,7 @@
 
     log_msg(2, "*** search to %s" % dest)
 
-    while not num_hops and not explicit and not desc.has_key(dest) and not fail:
+    while not desc.has_key(dest) and not fail:
         chosen_dir = ""
         min = MAXINT
 
@@ -1668,69 +1668,15 @@
         except ErrorReply, e:
             log_msg(1, e)
 
-    ## -- THESIS EXPERIMENT SECTION --
-
-    elif num_hops:
-        circID = 0
-        for i in range(1, num_hops):
-            chosen_dir = target_array[i % len(target_array)]
-
-            ff = 0
-            if circID:
-                ff = 1
-                semaphore[circID] = 0
-            circID = conn.extend_circuit(circID, [chosen_dir])
-
-            if ff:
-                start_time = time.time()
-                while(semaphore[circID] == 0):
-                    time.sleep(0.1)
-
-            if semaphore.has_key(circID) and semaphore[circID] == -1:
-                log_msg(1, "--- circuit failed")
-                del semaphore[circID]
-                break
-
-            if query_server:
-                if port.has_key(chosen_dir):
-                    chosen_server = "%s:%s" % (chosen_dir, port[chosen_dir])
-                    url = "http://%s.exit:%s/blossom/%s" % (chosen_dir, port[chosen_dir], dest)
-                else:
-                    log_msg(1, "NO PORT AVAILABLE for %s" % chosen_dir)
-
-                try:
-                    h = httplib.HTTP(sh, sp)
-                    h.putrequest('GET', url)
-                    h.endheaders()
-                    errcode, errmsg, headers = h.getreply()
-                    log_msg(2, "<-- HTTP-GET %s:%s %s: %s" % (sh, sp, url, str(errcode)))
-                    h = h.file
-                    desc = process_descriptors(h, "")
-                except AttributeError, e:
-                    log_msg(1, "AttributeError")
-                except socket.error, (ec, em):
-                    log_msg(1, "socket.error %s %s" % (repr(ec), repr(em)))
-                except IOError, (ec, em):
-                    log_msg(1, "IOError %s %s" % (repr(ec), repr(em)))
-
-        if semaphore.has_key(circID):
-            conn.close_circuit(circID)
-            conn.close_stream(streamID, 1)
-
-    ## -- END THESIS EXPERIMENT SECTION --
-
     else:
         log_msg(2, "*** BLOSSOM: reachable destination %s" % dest)
         try:
-            if explicit:
-                seq = [explicit]
-            else:
-                if path.has_key(dest):
-                    log_msg(2, "*** path[%s]: %s" % (dest, path[dest]))
-                    for rtr in path[dest]:
-                        if rtr != chosen_dir and rtr != NICK:
-                            seq.append(rtr)
-                seq.append(dest)
+            if path.has_key(dest):
+                log_msg(2, "*** path[%s]: %s" % (dest, path[dest]))
+                for rtr in path[dest]:
+                    if rtr != chosen_dir and rtr != NICK:
+                        seq.append(rtr)
+            seq.append(dest)
 
             if not circID and len(seq) > 2:
                 log_msg(2, "*** EXTENDING for search")



More information about the tor-commits mailing list