Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) To avoid confusion location will now also be displayed for own peer See: http://www.yacy-forum.de/viewtopic.php?p=17283#17283

theliaa87df35e195
diff --git a/htroot/Network.java b/htroot/Network.java
index 5b91f4fb6..a65d9e57a 100644
--- a/htroot/Network.java
+++ b/htroot/Network.java
@@ -51,6 +51,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.io.IOException;
import de.anomic.http.httpHeader;
+import de.anomic.http.httpc;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.server.serverDate;
@@ -312,7 +313,12 @@ public class Network {
}
prop.put(STR_TABLE_LIST + conCount + "_shortname", shortname);
prop.put(STR_TABLE_LIST + conCount + "_fullname", seed.get(yacySeed.NAME, "deadlink"));
- userAgent = yacyCore.peerActions.getUserAgent(seed.getIP());
+ userAgent = null;
+ if (seed.hash.equals(yacyCore.seedDB.mySeed.hash)) {
+ userAgent = httpc.userAgent;
+ } else {
+ userAgent = yacyCore.peerActions.getUserAgent(seed.getIP());
+ }
p = userAgent.lastIndexOf(';');
location = (p > 0) ? userAgent.substring(p + 1, userAgent.length() - 1).trim(): "";
prop.put(STR_TABLE_LIST + conCount + "_location", location);
diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.java
index db1726f86..68e688ec8 100644
--- a/source/de/anomic/http/httpc.java
+++ b/source/de/anomic/http/httpc.java
@@ -104,7 +104,7 @@ public final class httpc {
// statics
private static final String vDATE = "20040602";
- private static String userAgent;
+ public static String userAgent;
private static final int terminalMaxLength = 30000;
private static final TimeZone GMTTimeZone = TimeZone.getTimeZone("GMT");
/**