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

[tor-commits] [metrics-db/master] Abort when reading an unrecognized bridge pool assignment line.



commit 1a4932372f3269ca2e44ee2a2f5b49eb9af10bdc
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Wed Mar 7 07:52:12 2012 +0100

    Abort when reading an unrecognized bridge pool assignment line.
    
    Skipping unrecognized lines means we'll write an incomplete sanitized
    bridge pool assignment file to disk, and we might not even notice.
---
 .../ernie/db/BridgePoolAssignmentsProcessor.java   |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java b/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java
index 583d36e..3f30569 100644
--- a/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java
+++ b/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java
@@ -97,8 +97,8 @@ public class BridgePoolAssignmentsProcessor {
             String[] parts = line.split(" ");
             if (parts.length < 2 || parts[0].length() < 40) {
               logger.warning("Unrecognized line '" + line
-                  + "'. Skipping.");
-              continue;
+                  + "'. Aborting.");
+              break;
             }
             String hashedFingerprint = null;
             try {
@@ -106,8 +106,8 @@ public class BridgePoolAssignmentsProcessor {
                   line.split(" ")[0].toCharArray())).toLowerCase();
             } catch (DecoderException e) {
               logger.warning("Unable to decode hex fingerprint in line '"
-                  + line + "'. Skipping.");
-              continue;
+                  + line + "'. Aborting.");
+              break;
             }
             String assignmentDetails = line.substring(40);
             sanitizedAssignments.add(hashedFingerprint

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits