diff options
| author | hermens <hermens@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2009-10-08 00:17:29 +0000 |
|---|---|---|
| committer | hermens <hermens@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2009-10-08 00:17:29 +0000 |
| commit | aeab8c7917ad84f614fc380ed1c8cedea279bc78 (patch) | |
| tree | 49b6bbb6e0c8b1799e9bd88b30bb90602e0767b0 | |
| parent | 9324b5b6c54fa175debeade3ee5e7c49aa213cbd (diff) | |
Prevent failed DHT attemps from overwriting newer peer info
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6382 6c8d7289-2bf4-0310-a012-ef5d649a1542
| -rw-r--r-- | source/de/anomic/yacy/dht/Transmission.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/de/anomic/yacy/dht/Transmission.java b/source/de/anomic/yacy/dht/Transmission.java index e45041799..e1b80199d 100644 --- a/source/de/anomic/yacy/dht/Transmission.java +++ b/source/de/anomic/yacy/dht/Transmission.java @@ -223,9 +223,20 @@ public class Transmission { } this.miss++; // write information that peer does not receive index transmissions - target.setFlagAcceptRemoteIndex(false); - seeds.update(target.hash, target); log.logInfo("Transfer failed of chunk to target " + target.hash + "/" + target.getName() + ": " + error); + // get possibly newer target Info + yacySeed newTarget = seeds.get(target.hash); + if (newTarget != null) { + String oldAddress = target.getPublicAddress(); + if ((oldAddress != null) && (oldAddress.equals(newTarget.getPublicAddress()))) { + newTarget.setFlagAcceptRemoteIndex(false); + seeds.update(newTarget.hash, newTarget); + } else { + // we tried an old Address. Don't change anything + } + } else { + // target not in DB anymore. ??? + } return false; } |
