commit bb770751631d86a5313679313be9084daa5be79b Author: Karsten Loesing karsten.loesing@gmx.net Date: Mon Apr 2 17:29:15 2012 +0200
Don't use server descriptors parse histories.
If we parse a relay or bridge server descriptor that we never saw before and learn about the relay or bridge in a later consensus or status, we'll never write the descriptor content anywhere. The result would be details files containing no descriptor parts until the relay or bridge publishes the next descriptor. Yes, this took a long time to track down. --- src/org/torproject/onionoo/DetailDataWriter.java | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/org/torproject/onionoo/DetailDataWriter.java b/src/org/torproject/onionoo/DetailDataWriter.java index a6198b1..1420297 100644 --- a/src/org/torproject/onionoo/DetailDataWriter.java +++ b/src/org/torproject/onionoo/DetailDataWriter.java @@ -57,7 +57,11 @@ public class DetailDataWriter { DescriptorSourceFactory.createDescriptorReader(); reader.addDirectory(new File( "in/relay-descriptors/server-descriptors")); - reader.setExcludeFiles(new File("status/relay-serverdesc-history")); + /* Don't remember which server descriptors we already parsed. If we + * parse a server descriptor now and first learn about the relay in a + * later consensus, we'll never write the descriptor content anywhere. + * The result would be details files containing no descriptor parts + * until the relay publishes the next descriptor. */ Iterator<DescriptorFile> descriptorFiles = reader.readDescriptors(); while (descriptorFiles.hasNext()) { DescriptorFile descriptorFile = descriptorFiles.next(); @@ -122,7 +126,11 @@ public class DetailDataWriter { DescriptorSourceFactory.createDescriptorReader(); reader.addDirectory(new File( "in/bridge-descriptors/server-descriptors")); - reader.setExcludeFiles(new File("status/bridge-serverdesc-history")); + /* Don't remember which server descriptors we already parsed. If we + * parse a server descriptor now and first learn about the relay in a + * later status, we'll never write the descriptor content anywhere. + * The result would be details files containing no descriptor parts + * until the bridge publishes the next descriptor. */ Iterator<DescriptorFile> descriptorFiles = reader.readDescriptors(); while (descriptorFiles.hasNext()) { DescriptorFile descriptorFile = descriptorFiles.next();
tor-commits@lists.torproject.org