Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3360 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
karlchenofhell committed Feb 10, 2007
1 parent ea20d8d commit 6c63755
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions htroot/IndexControl_p.java
Expand Up @@ -78,7 +78,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;

serverObjects prop = new serverObjects();

if (post == null || env == null) {
prop.put("keystring", "");
prop.put("keyhash", "");
Expand All @@ -93,9 +93,10 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("indexReceiveChecked", (switchboard.getConfig("allowReceiveIndex", "true").equals("true")) ? 1 : 0);
prop.put("indexReceiveBlockBlacklistChecked", (switchboard.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0);
prop.put("peertags", serverCodings.set2string(yacyCore.seedDB.mySeed.getPeerTags(), ",", false));
listHosts(prop, "");
return prop; // be save
}

// default values
String keystring = ((String) post.get("keystring", "")).trim();
String keyhash = ((String) post.get("keyhash", "")).trim();
Expand Down Expand Up @@ -381,12 +382,27 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("result", "No Entries for URL hash " + urlhash);
}
}

listHosts(prop, keyhash);

// insert constants
prop.put("wcount", Integer.toString(switchboard.wordIndex.size()));
prop.put("ucount", Integer.toString(switchboard.wordIndex.loadedURL.size()));
prop.put("indexDistributeChecked", (switchboard.getConfig("allowDistributeIndex", "true").equals("true")) ? 1 : 0);
prop.put("indexDistributeWhileCrawling", (switchboard.getConfig("allowDistributeIndexWhileCrawling", "true").equals("true")) ? 1 : 0);
prop.put("indexReceiveChecked", (switchboard.getConfig("allowReceiveIndex", "true").equals("true")) ? 1 : 0);
prop.put("indexReceiveBlockBlacklistChecked", (switchboard.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0);
prop.put("peertags", serverCodings.set2string(yacyCore.seedDB.mySeed.getPeerTags(), ",", false));
// return rewrite properties
return prop;
}

private static void listHosts(serverObjects prop, String startHash) {
// list known hosts
yacySeed seed;
int hc = 0;
if (yacyCore.seedDB != null && yacyCore.seedDB.sizeConnected() > 0) {
Enumeration e = yacyCore.dhtAgent.getAcceptRemoteIndexSeeds(keyhash);
Enumeration e = yacyCore.dhtAgent.getAcceptRemoteIndexSeeds(startHash);
while (e.hasMoreElements()) {
seed = (yacySeed) e.nextElement();
if (seed != null) {
Expand All @@ -399,17 +415,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
} else {
prop.put("hosts", "0");
}

// insert constants
prop.put("wcount", Integer.toString(switchboard.wordIndex.size()));
prop.put("ucount", Integer.toString(switchboard.wordIndex.loadedURL.size()));
prop.put("indexDistributeChecked", (switchboard.getConfig("allowDistributeIndex", "true").equals("true")) ? 1 : 0);
prop.put("indexDistributeWhileCrawling", (switchboard.getConfig("allowDistributeIndexWhileCrawling", "true").equals("true")) ? 1 : 0);
prop.put("indexReceiveChecked", (switchboard.getConfig("allowReceiveIndex", "true").equals("true")) ? 1 : 0);
prop.put("indexReceiveBlockBlacklistChecked", (switchboard.getConfig("indexReceiveBlockBlacklist", "true").equals("true")) ? 1 : 0);
prop.put("peertags", serverCodings.set2string(yacyCore.seedDB.mySeed.getPeerTags(), ",", false));
// return rewrite properties
return prop;
}

public static serverObjects genUrlProfile(plasmaSwitchboard switchboard, indexURLEntry entry, String urlhash) {
Expand Down

0 comments on commit 6c63755

Please sign in to comment.