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

[tor-commits] [metrics-lib/master] Add @type annotations for sanitized bridge descriptors.



commit 49a88e7eaaf3fea6736aba5df44905d3e7210eb7
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Sat May 19 11:48:29 2012 +0200

    Add @type annotations for sanitized bridge descriptors.
    
    Spotted by Damian.
---
 .../torproject/descriptor/impl/DescriptorImpl.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/org/torproject/descriptor/impl/DescriptorImpl.java b/src/org/torproject/descriptor/impl/DescriptorImpl.java
index 7062b58..afaacc7 100644
--- a/src/org/torproject/descriptor/impl/DescriptorImpl.java
+++ b/src/org/torproject/descriptor/impl/DescriptorImpl.java
@@ -40,16 +40,19 @@ public abstract class DescriptorImpl implements Descriptor {
       parsedDescriptors.addAll(RelayNetworkStatusVoteImpl.
           parseVotes(rawDescriptorBytes,
           failUnrecognizedDescriptorLines));
-    } else if (firstLines.startsWith("r ")) {
+    } else if (firstLines.startsWith("@type bridge-network-status 1.0\n")
+        || firstLines.startsWith("r ")) {
       parsedDescriptors.add(new BridgeNetworkStatusImpl(
           rawDescriptorBytes, fileName, failUnrecognizedDescriptorLines));
     } else if (firstLines.startsWith("@type server-descriptor 1.0\n") ||
+        firstLines.startsWith("@type bridge-server-descriptor 1.0\n") ||
         firstLines.startsWith("router ") ||
         firstLines.contains("\nrouter ")) {
       parsedDescriptors.addAll(ServerDescriptorImpl.
           parseDescriptors(rawDescriptorBytes,
           failUnrecognizedDescriptorLines));
     } else if (firstLines.startsWith("@type extra-info 1.0\n") ||
+        firstLines.startsWith("@type bridge-extra-info 1.0\n") ||
         firstLines.startsWith("extra-info ") ||
         firstLines.contains("\nextra-info ")) {
       parsedDescriptors.addAll(ExtraInfoDescriptorImpl.

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