[or-cvs] [ernie/master] Don't try to download non-existing votes of legacy dir-source lines.

karsten at torproject.org karsten at torproject.org
Wed Apr 14 13:07:41 UTC 2010


Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Wed, 14 Apr 2010 14:52:14 +0200
Subject: Don't try to download non-existing votes of legacy dir-source lines.
Commit: 7601dfbef13d06749602034cb9ebe73f7422326b

---
 src/RelayDescriptorParser.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/RelayDescriptorParser.java b/src/RelayDescriptorParser.java
index 3a9b96d..c80913b 100644
--- a/src/RelayDescriptorParser.java
+++ b/src/RelayDescriptorParser.java
@@ -121,7 +121,7 @@ public class RelayDescriptorParser {
         String validAfterTime = null, descriptorIdentity = null,
             serverDesc = null;
         StringBuilder descriptorIdentities = new StringBuilder();
-        String fingerprint = null;
+        String fingerprint = null, dirSource = null;
         long validAfter = -1L;
         SortedSet<String> dirSources = new TreeSet<String>();
         SortedSet<String> serverDescriptors = new TreeSet<String>();
@@ -133,7 +133,9 @@ public class RelayDescriptorParser {
             validAfterTime = line.substring("valid-after ".length());
             validAfter = parseFormat.parse(validAfterTime).getTime();
           } else if (line.startsWith("dir-source ")) {
-            dirSources.add(line.split(" ")[2]);
+            dirSource = line.split(" ")[2];
+          } else if (line.startsWith("vote-digest ")) {
+            dirSources.add(dirSource);
           } else if (line.startsWith("fingerprint ")) {
             fingerprint = line.split(" ")[1];
           } else if (line.startsWith("r ")) {
-- 
1.6.5



More information about the tor-commits mailing list