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

[tor-commits] [onionoo/release] Fix the "running" field in bridge details documents.



commit 68819a084f60eb2e0453f21ac6986a15e2217d5b
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Sep 19 12:06:33 2017 +0200

    Fix the "running" field in bridge details documents.
    
    When we set this field in the update process, we only looked whether
    the bridge is contained in the last known bridge network status. We
    also need to check whether it has the "Running" flag assigned there.
    
    This is different from relays, because the consensus only lists relays
    with the "Running" flag since a couple of years, whereas the bridge
    network status lists all known bridges.
    
    Fixes #23467. Spotted by nusenu.
---
 CHANGELOG.md                                                         | 5 +++++
 .../org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java     | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f817060..b9a171d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Changes in version 4.?-?.?.? - 2017-??-??
 
+ * Medium changes
+   - Only set the "running" field in a bridge's details document to
+     true if the bridge is both contained in the last known bridge
+     network status and has the "Running" flag assigned there.
+
  * Minor changes
    - Remove placeholder page on index.html.
 
diff --git a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
index 9fcff35..ff14d75 100644
--- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -863,7 +863,8 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
       }
 
       detailsStatus.setRelay(nodeStatus.isRelay());
-      detailsStatus.setRunning(nodeStatus.getLastSeenMillis()
+      detailsStatus.setRunning(nodeStatus.getRelayFlags().contains("Running")
+          && nodeStatus.getLastSeenMillis()
           == (nodeStatus.isRelay() ? this.relaysLastValidAfterMillis
           : this.bridgesLastPublishedMillis));
       detailsStatus.setNickname(nodeStatus.getNickname());



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