Skip to content

Commit

Permalink
*)Undoing peername sorting
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@716 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
theli committed Sep 13, 2005
1 parent 61d3b23 commit 7638b41
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions htroot/IndexControl_p.java
Expand Up @@ -50,9 +50,6 @@
import java.util.HashSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.TreeMap;

import de.anomic.htmlFilter.htmlFilterContentScraper;
import de.anomic.http.httpHeader;
Expand Down Expand Up @@ -312,27 +309,20 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
//List known hosts
yacySeed seed;
int hc = 0;
if ((yacyCore.seedDB != null) && (yacyCore.seedDB.sizeConnected() > 0)) {
Enumeration e = yacyCore.dhtAgent.getAcceptRemoteIndexSeeds(keyhash);
TreeMap hostList = new TreeMap();
while (e.hasMoreElements()) {
seed = (yacySeed) e.nextElement();
if (seed != null) hostList.put(seed.get("Name", "nameless"),seed.hash);
}

String hostName = null;
try {
while ((hostName = (String) hostList.firstKey()) != null) {
prop.put("hosts_" + hc + "_hosthash", hostList.get(hostName));
prop.put("hosts_" + hc + "_hostname", /*seed.hash + " " +*/ hostName);
hc++;
hostList.remove(hostName);
if ((yacyCore.seedDB != null) && (yacyCore.seedDB.sizeConnected() > 0)) {
Enumeration e = yacyCore.dhtAgent.getAcceptRemoteIndexSeeds(keyhash);
while (e.hasMoreElements()) {
seed = (yacySeed) e.nextElement();
if (seed != null) {
prop.put("hosts_" + hc + "_hosthash", seed.hash);
prop.put("hosts_" + hc + "_hostname", /*seed.hash + " " +*/ seed.get("Name", "nameless"));
hc++;
}
} catch (NoSuchElementException ex) {}
}
prop.put("hosts", Integer.toString(hc));
} else {
} else {
prop.put("hosts", "0");
}
}

// insert constants
prop.put("wcount", Integer.toString(switchboard.wordIndex.size()));
Expand Down

0 comments on commit 7638b41

Please sign in to comment.