[tor-commits] [metrics-tasks/master] Tweak server descriptor verifier (#2768).

karsten at torproject.org karsten at torproject.org
Tue Apr 17 16:26:48 UTC 2012


commit ed7759ff1afaa926b0823bd94c80330ede4e8f12
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Tue Apr 17 18:23:49 2012 +0200

    Tweak server descriptor verifier (#2768).
    
    Now we learn when a descriptor file could not be parsed due to
    non-crypto-related issues, rather than silently ignoring it.
---
 task-2768/VerifyServerDescriptors.java |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/task-2768/VerifyServerDescriptors.java b/task-2768/VerifyServerDescriptors.java
index c1cf766..e648d92 100644
--- a/task-2768/VerifyServerDescriptors.java
+++ b/task-2768/VerifyServerDescriptors.java
@@ -52,6 +52,12 @@ public class VerifyServerDescriptors {
     int processedDescriptors = 0, verifiedDescriptors = 0;
     while (descriptorFiles.hasNext()) {
       DescriptorFile descriptorFile = descriptorFiles.next();
+      if (descriptorFile.getException() != null) {
+        System.err.println("Could not read/parse descriptor file "
+            + descriptorFile.getFileName() + ": "
+            + descriptorFile.getException().getMessage());
+        continue;
+      }
       if (descriptorFile.getDescriptors() == null) {
         continue;
       }



More information about the tor-commits mailing list