Skip to content

Commit

Permalink
do not accept dht from bad versions
Browse files Browse the repository at this point in the history
delete bad hashes on receive

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5852 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
lotus committed Apr 22, 2009
1 parent 16baa7a commit daea87d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion htroot/yacy/transferRWI.java
Expand Up @@ -107,6 +107,11 @@ public static serverObjects respond(final httpRequestHeader header, final server
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
Expand Down Expand Up @@ -141,7 +146,7 @@ public static serverObjects respond(final httpRequestHeader header, final server

// 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;
}
Expand Down

0 comments on commit daea87d

Please sign in to comment.