[or-cvs] [ernie/master 1/2] Fix logic to re-write network statuses after sanitizing descriptors.

karsten at torproject.org karsten at torproject.org
Thu Apr 8 12:40:34 UTC 2010


Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Thu, 8 Apr 2010 14:37:30 +0200
Subject: Fix logic to re-write network statuses after sanitizing descriptors.
Commit: f0b95553596367bca380c79d554dd903c4b1a47d

---
 src/SanitizedBridgesWriter.java |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/SanitizedBridgesWriter.java b/src/SanitizedBridgesWriter.java
index faa589e..039de5c 100644
--- a/src/SanitizedBridgesWriter.java
+++ b/src/SanitizedBridgesWriter.java
@@ -1037,9 +1037,9 @@ public class SanitizedBridgesWriter {
      * descriptor. We keep the timestamp of the last re-written network
      * status in order to make sure we re-writing any network status at
      * most once. */
-    String lastRewrittenStatusMinus24Hours = "1970-01-01 00:00:00";
+    String lastDescriptorPublishedPlus24Hours = "1970-01-01 00:00:00";
     for (String published : this.descriptorPublicationTimes) {
-      if (published.compareTo(lastRewrittenStatusMinus24Hours) <= 0) {
+      if (published.compareTo(lastDescriptorPublishedPlus24Hours) <= 0) {
         continue;
       }
       // find statuses 24 hours after published
@@ -1061,6 +1061,7 @@ public class SanitizedBridgesWriter {
             listFiles()));
       }
       long plus24Hours = publishedTime + 24L * 60L * 60L * 1000L;
+      lastDescriptorPublishedPlus24Hours = dateFormat.format(plus24Hours);
       String[] dayTwo = dateFormat.format(plus24Hours).split("-");
       File publishedDayTwo = new File(this.sanitizedBridgesDir + "/"
           + dayTwo[0] + "/" + dayTwo[1] + "/statuses/" + dayTwo[2]);
@@ -1084,8 +1085,6 @@ public class SanitizedBridgesWriter {
         }
         this.rewriteNetworkStatus(status,
             dateTimeFormat.format(statusTime));
-        lastRewrittenStatusMinus24Hours = dateTimeFormat.format(
-            statusTime - 24L * 60L * 60L * 1000L);
       }
     }
 
-- 
1.6.5




More information about the tor-commits mailing list