[or-cvs] r19203: {torctl} Print a WARN if we get a NEWDESC without an NS instead of ex (torctl/trunk/python/TorCtl)

mikeperry at seul.org mikeperry at seul.org
Tue Mar 31 11:39:22 UTC 2009


Author: mikeperry
Date: 2009-03-31 07:39:22 -0400 (Tue, 31 Mar 2009)
New Revision: 19203

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

Print a WARN if we get a NEWDESC without an NS
instead of exploding in firey death.



Modified: torctl/trunk/python/TorCtl/TorCtl.py
===================================================================
--- torctl/trunk/python/TorCtl/TorCtl.py	2009-03-31 11:38:16 UTC (rev 19202)
+++ torctl/trunk/python/TorCtl/TorCtl.py	2009-03-31 11:39:22 UTC (rev 19203)
@@ -1187,8 +1187,13 @@
   def new_desc_event(self, d):
     update = False
     for i in d.idlist:
-      ns = self.c.get_network_status("id/"+i)
-      r = self.c.read_routers(ns)
+      r = None
+      try:
+        ns = self.c.get_network_status("id/"+i)
+        r = self.c.read_routers(ns)
+      except ErrorReply, e:
+        plog("WARN", "Error reply for "+i+" after NEWDESC: "+str(e))
+        continue
       if not r:
         plog("WARN", "No router desc for "+i+" after NEWDESC")
         continue



More information about the tor-commits mailing list