[tor-commits] [onionoo/master] Skip corrupt weights data lines.
karsten at torproject.org
karsten at torproject.org
Fri Jul 12 19:10:00 UTC 2013
commit 33b60cde97a83891b62977e414ca2b4cd75b1a4f
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Wed Jul 10 10:39:44 2013 +0200
Skip corrupt weights data lines.
There was a bug in one of the previous commits which made us write NaN
values to weights status files. Remove those lines when reading files.
---
src/org/torproject/onionoo/WeightsDataWriter.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/org/torproject/onionoo/WeightsDataWriter.java b/src/org/torproject/onionoo/WeightsDataWriter.java
index e388ddd..260cdc8 100644
--- a/src/org/torproject/onionoo/WeightsDataWriter.java
+++ b/src/org/torproject/onionoo/WeightsDataWriter.java
@@ -285,6 +285,11 @@ public class WeightsDataWriter implements DescriptorListener {
+ "Skipping this line.");
continue;
}
+ if (parts[4].equals("NaN")) {
+ /* Remove corrupt lines written on 2013-07-07 and the days
+ * after. */
+ continue;
+ }
long validAfterMillis = dateTimeFormat.parse(parts[0]
+ " " + parts[1]).getTime();
long freshUntilMillis = dateTimeFormat.parse(parts[2]
More information about the tor-commits
mailing list