fix for wrong "VegaYacyB" peers

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5077 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 17 years ago
parent 296fa2265b
commit 08cdf6db8a

@ -834,6 +834,7 @@ public class yacySeed implements Cloneable {
// name // name
final String peerName = this.dna.get(yacySeed.NAME); final String peerName = this.dna.get(yacySeed.NAME);
if (peerName == null) return "no peer name given"; if (peerName == null) return "no peer name given";
if (peerName.equalsIgnoreCase("VegaYacyB")) return "bad peer VegaYacyB [ " + this.hash + " ]"; // hack for wrong "VegaYacyB" peers
dna.put(yacySeed.NAME, checkPeerName(peerName)); dna.put(yacySeed.NAME, checkPeerName(peerName));
// type // type

@ -439,7 +439,7 @@ public final class yacySeedDB implements httpdAlternativeDomainNames {
public long countPotentialRWI() { return seedPotentialDB.getLongAcc(yacySeed.ICOUNT); } public long countPotentialRWI() { return seedPotentialDB.getLongAcc(yacySeed.ICOUNT); }
public synchronized void addConnected(final yacySeed seed) { public synchronized void addConnected(final yacySeed seed) {
if ((seed == null) || (seed.isProper(false) != null)) return; if (seed.isProper(false) != null) return;
//seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime()))); //seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
try { try {
nameLookupCache.put(seed.getName(), seed); nameLookupCache.put(seed.getName(), seed);
@ -462,7 +462,7 @@ public final class yacySeedDB implements httpdAlternativeDomainNames {
} }
public synchronized void addDisconnected(final yacySeed seed) { public synchronized void addDisconnected(final yacySeed seed) {
if (seed == null) return; if (seed.isProper(false) != null) return;
try { try {
nameLookupCache.remove(seed.getName()); nameLookupCache.remove(seed.getName());
seedActiveDB.remove(seed.hash); seedActiveDB.remove(seed.hash);
@ -487,13 +487,12 @@ public final class yacySeedDB implements httpdAlternativeDomainNames {
} }
public synchronized void addPotential(final yacySeed seed) { public synchronized void addPotential(final yacySeed seed) {
if (seed == null) return; if (seed.isProper(false) != null) return;
try { try {
nameLookupCache.remove(seed.getName()); nameLookupCache.remove(seed.getName());
seedActiveDB.remove(seed.hash); seedActiveDB.remove(seed.hash);
seedPassiveDB.remove(seed.hash); seedPassiveDB.remove(seed.hash);
} catch (final Exception e) { serverLog.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); } } catch (final Exception e) { serverLog.logWarning("yacySeedDB", "could not remove hash ("+ e.getClass() +"): "+ e.getMessage()); }
if (seed.isProper(false) != null) return;
//seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime()))); //seed.put(yacySeed.LASTSEEN, yacyCore.shortFormatter.format(new Date(yacyCore.universalTime())));
try { try {
final HashMap<String, String> seedPropMap = seed.getMap(); final HashMap<String, String> seedPropMap = seed.getMap();

Loading…
Cancel
Save