[tor-commits] [collector/master] Handle bridge network statuses without entries.
karsten at torproject.org
karsten at torproject.org
Wed Aug 16 18:15:38 UTC 2017
commit f6e9d647a3af851b2bf624f25bfb410c07cba254
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Wed Aug 16 18:00:30 2017 +0200
Handle bridge network statuses without entries.
Fixes #23255.
---
CHANGELOG.md | 6 ++++++
.../torproject/collector/bridgedescs/SanitizedBridgesWriter.java | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 61d8f1e..59690ca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+# Changes in version 1.2.1 - 2017-08-??
+
+ * Medium changes
+ - Fix a bug while sanitizing bridge network statuses without entries.
+
+
# Changes in version 1.2.0 - 2017-07-12
* Major changes
diff --git a/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java b/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java
index e3abf16..f53a3d1 100644
--- a/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java
+++ b/src/main/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriter.java
@@ -600,7 +600,11 @@ public class SanitizedBridgesWriter extends CollecTorMain {
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
- if (formatter.parse(publicationTime).getTime()
+ if (null == mostRecentDescPublished) {
+ logger.warn("The bridge network status published at " + publicationTime
+ + " does not contain a single entry. Please ask the bridge "
+ + "authority operator to check!");
+ } else if (formatter.parse(publicationTime).getTime()
- formatter.parse(mostRecentDescPublished).getTime()
> 60L * 60L * 1000L) {
logger.warn("The most recent descriptor in the bridge "
More information about the tor-commits
mailing list