From 1dfab1abe3bea191f01d49504c31e13e34726317 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 4 Oct 2006 08:55:01 +0000 Subject: [PATCH] more control for seed receive git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2709 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/yacyPeerActions.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.java index 9aff491d0..6c926fd89 100644 --- a/source/de/anomic/yacy/yacyPeerActions.java +++ b/source/de/anomic/yacy/yacyPeerActions.java @@ -48,6 +48,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -378,7 +379,13 @@ public class yacyPeerActions { if (connectedSeed.getName() != seed.getName()) { // TODO: update seed name lookup cache } - } catch (java.text.ParseException e) {} + } catch (ParseException e) { + yacyCore.log.logFine("connect: rejecting wrong peer '" + seed.getName() + "' from " + seed.getAddress() + ". Cause: " + e.getMessage()); + return false; + } catch (NumberFormatException e) { + yacyCore.log.logFine("connect: rejecting wrong peer '" + seed.getName() + "' from " + seed.getAddress() + ". Cause: " + e.getMessage()); + return false; + } yacyCore.log.logFine("connect: updated KNOWN " + ((direct) ? "direct " : "") + peerType + " peer '" + seed.getName() + "' from " + seed.getAddress()); seedDB.addConnected(seed); return true;