[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [onionoo/master] Flush cached hostname when a relay's IP changes.
commit eedbcbe52160d0250d31bb4f6ee7644815fd989d
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed Feb 10 19:48:19 2016 +0100
Flush cached hostname when a relay's IP changes.
When reading a node status from disk, only remember the last lookup
time if the address has not changed. Otherwise we'll want to do a
fresh lookup.
Implements #18270.
---
.../org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
index b9552bf..d282ab8 100644
--- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -446,6 +446,12 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
if (this.knownNodes.containsKey(fingerprint)) {
updatedNodeStatus = this.knownNodes.get(fingerprint);
String address = nodeStatus.getAddress();
+ if (address.equals(updatedNodeStatus.getAddress())) {
+ /* Only remember the last lookup time if the address has not
+ * changed. Otherwise we'll want to do a fresh lookup. */
+ updatedNodeStatus.setLastRdnsLookup(
+ nodeStatus.getLastRdnsLookup());
+ }
int orPort = nodeStatus.getOrPort();
int dirPort = nodeStatus.getDirPort();
SortedSet<String> orAddressesAndPorts =
@@ -478,8 +484,6 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
updatedNodeStatus.setFirstSeenMillis(
nodeStatus.getFirstSeenMillis());
}
- updatedNodeStatus.setLastRdnsLookup(
- nodeStatus.getLastRdnsLookup());
updatedNodeStatus.setDeclaredFamily(
nodeStatus.getDeclaredFamily());
updatedNodeStatus.setEffectiveFamily(
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits