From daea87d436f29183d7bd16b8578063db785c802f Mon Sep 17 00:00:00 2001 From: lotus Date: Wed, 22 Apr 2009 12:13:37 +0000 Subject: [PATCH] do not accept dht from bad versions delete bad hashes on receive git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5852 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacy/transferRWI.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.java index 7bf1ba4e6..42cf569ba 100644 --- a/htroot/yacy/transferRWI.java +++ b/htroot/yacy/transferRWI.java @@ -107,6 +107,11 @@ public final class transferRWI { granted = false; // don't accept more words if there are too many words to flush result = "busy"; pause = 60000; + } else if (otherPeer.getVersion() < 0.75005845 && otherPeer.getVersion() >= 0.75005821) { + // version that sends [B@... hashes + sb.getLog().logInfo("Rejecting RWIs from peer " + otherPeerName + ". Bad version."); + result = "not_granted"; + pause = 1800000; } else { // we want and can receive indexes // log value status (currently added to find outOfMemory error @@ -141,7 +146,7 @@ public final class transferRWI { // check if RWI entry is well-formed p = estring.indexOf("{"); - if ((p < 0) || (estring.indexOf("x=") < 0)) { + if ((p < 0) || (estring.indexOf("x=") < 0) || !(estring.indexOf("[B@") < 0)) { blocked++; continue; }