Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed parsing of peer flags
Michael Peter Christen5091d627bc2d
diff --git a/source/net/yacy/peers/Seed.java b/source/net/yacy/peers/Seed.javaindex e32b261e1..1f8c5a2a2 100644--- a/source/net/yacy/peers/Seed.java+++ b/source/net/yacy/peers/Seed.java@@ -196,10 +196,10 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>assert theHash != null;this.hash = theHash;this.dna = theDna;- final String flags = this.dna.get(Seed.FLAGS);- if ( (flags == null) || (flags.length() != 4) ) {- this.dna.put(Seed.FLAGS, Seed.FLAGSZERO);- }+ String flags = this.dna.get(Seed.FLAGS);+ if (flags == null) flags = Seed.FLAGSZERO;+ while (flags.length() < 4) flags += " ";+ this.dna.put(Seed.FLAGS, flags);this.dna.put(Seed.NAME, checkPeerName(get(Seed.NAME, "∅")));this.birthdate = -1; // this means 'not yet parsed', parse that later when it is used}@@ -1007,6 +1007,7 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>if ( testResult != null ) {throw new IOException("seed is not proper (" + testResult + "): " + resultSeed);}+ //assert resultSeed.toString().equals(seed) : "\nresultSeed.toString() = " + resultSeed.toString() + ",\n seed = " + seed; // debug// seed okreturn resultSeed;@@ -1092,7 +1093,8 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>final ConcurrentMap<String, String> copymap = new ConcurrentHashMap<String, String>();copymap.putAll(this.dna);copymap.put(Seed.HASH, this.hash); // set hash into seed code structure- return MapTools.map2string(copymap, ",", true); // generate string representation+ String s = MapTools.map2string(copymap, ",", true); // generate string representation+ return s;}public final String genSeedStr(final String key) {