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

[or-cvs] r15679: make the directory work again by default (blossom/trunk)



Author: goodell
Date: 2008-07-05 18:16:18 -0400 (Sat, 05 Jul 2008)
New Revision: 15679

Modified:
   blossom/trunk/blossom.py
Log:
make the directory work again by default


Modified: blossom/trunk/blossom.py
===================================================================
--- blossom/trunk/blossom.py	2008-07-05 22:15:59 UTC (rev 15678)
+++ blossom/trunk/blossom.py	2008-07-05 22:16:18 UTC (rev 15679)
@@ -112,7 +112,7 @@
 STATUS_ARGS         = "t=1"
 
 HTTP_PROXY          = "localhost:3128"
-DIR_SERVER          = "0.0.0.0:9030"
+DIR_SERVER          = "0.0.0.0:9031"
 TORCONTROL          = "localhost:9051"
 SERVER              = "localhost:9052"
 
@@ -635,6 +635,7 @@
            numeric stream ID, and 'target' is the destination of the stream.
         """
         global conn
+        global fpmap
 
         eventtype   = s.event_name
         status      = s.status
@@ -730,9 +731,9 @@
                 m = re.search(r'^(.*\.)?([A-Za-z0-9-]+)\.exit(:[0-9]+)?$', target)
                 if m:
                     dest = m.group(2)
-                    if fingerprint.has_key(dest):
-                        log_msg(2, "*** converting fingerprint %s -> %s" % (dest, fingerprint[dest]))
-                        dest = fingerprint[dest]
+                    if fpmap.has_key(dest):
+                        log_msg(2, "*** converting fingerprint %s -> %s" % (dest, fpmap[dest]))
+                        dest = fpmap[dest]
 
                 # test for unconverted fingerprints
                 if len(dest) > MAXNICKLEN and re.match(r'^[0-9A-F]+$', dest):
@@ -839,8 +840,8 @@
             except TorCtlClosed:
                 log_msg(1, "CONTROLLER CONNECTION CLOSED: %s" % repr(ex))
                 CONNECTION_CLOSED = 1
-            except:
-                log_msg(1, "stream_status unexpected: %s" % sys.exc_info()[0])
+#            except:
+#                log_msg(1, "stream_status unexpected: %s" % sys.exc_info()[0])
             log_msg(2, "*** internal processing complete for stream %s" % streamID)
 
         if status in ("FAILED", "CLOSED"):
@@ -1024,7 +1025,7 @@
                 sys.exc_info()[0]))
 
     def do_POST(self):
-        log_msg(3, "<-- HTTP-POST %s from %s:%s" \
+        log_msg(2, "<-- HTTP-POST %s from %s:%s" \
             % (self.path, self.client_address[0], self.client_address[1]))
         try:
             curr_time = time.time()
@@ -1384,7 +1385,7 @@
         if persist_nickname.has_key(b):
             postable += "blossom-path %s %s\n" % (NICK, persist_nickname[b])
         else:
-            log_msg(2, "warning: %s not in %s" % (b, persist_nickname.keys()))
+            log_msg(1, "warning: %s not in %s" % (b, persist_nickname.keys()))
             f = 0
     else:
         postable += "blossom-path %s\n" % NICK
@@ -2325,6 +2326,8 @@
     new_path = []
     new_meta = []
 
+    # log_msg(3, "parse_blossom: %s" % lines)
+
     processing_router = 0
     if len(lines) == 0:
         return
@@ -2744,6 +2747,7 @@
         m = re.match(r'^directory\s+(\S+)\s*$', conflines[index])
         if m:
             DIR_SERVER = m.group(1)
+            BLOSSOM = [DIR_SERVER]
 
         m = re.match(r'^neighbor\s+(\S+)\s+(\S+)\s+(\S+)\s*$', conflines[index])
         if m:
@@ -3016,7 +3020,6 @@
     global counted_streams
     global dir_metadata
     global failed_streams
-    global fingerprint
     global interesting_ports
     global local
     global metadata