Skip to content

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

added some attributes to network picture

orbiterb0036249c139
diff --git a/htroot/NetworkPicture.java b/htroot/NetworkPicture.java
index 48c347d7d..7fe8d7cb8 100644
--- a/htroot/NetworkPicture.java
+++ b/htroot/NetworkPicture.java
@@ -61,6 +61,7 @@ public class NetworkPicture {
int passiveLimit = 300;
int potentialLimit = 300;
int maxCount = 1000;
+ boolean corona = true;
if (post != null) {
width = post.getInt("width", 640);
@@ -68,17 +69,18 @@ public class NetworkPicture {
passiveLimit = post.getInt("pal", 300);
potentialLimit = post.getInt("pol", 300);
maxCount = post.getInt("max", 1000);
+ corona = post.get("corona", "true").equals("true");
}
//too small values lead to an error, too big to huge CPU/memory consumption, resulting in possible DOS.
if (width < 320 ) width = 320;
if (width > 1920) width = 1920;
if (height < 240) height = 240;
- if (height > 1200) height = 1200;
+ if (height > 1920) height = 1920;
if (passiveLimit > 1000000) passiveLimit = 1000000;
if (potentialLimit > 1000000) potentialLimit = 1000000;
if (maxCount > 1000) maxCount = 1000;
- return plasmaGrafics.getNetworkPicture(10000, width, height, passiveLimit, potentialLimit, maxCount);
+ return plasmaGrafics.getNetworkPicture(10000, width, height, passiveLimit, potentialLimit, maxCount, corona);
}
}
diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.java
index 5e543f6f9..8235fad33 100644
--- a/source/de/anomic/http/httpc.java
+++ b/source/de/anomic/http/httpc.java
@@ -732,16 +732,6 @@ public final class httpc {
if (!(header.containsKey(httpHeader.CONNECTION))) {
header.put(httpHeader.CONNECTION, "close");
}
-
- // advertise a little bit...
- /*
- if ( (!(header.containsKey(httpHeader.REFERER))) || (((String) header.get(httpHeader.REFERER)).trim().length() == 0)&& useYacyReferer ) {
- header.put(httpHeader.REFERER,
- (((System.currentTimeMillis() >> 10) & 1) == 0) ?
- "http://www.anomic.de" :
- "http://www.yacy.net/yacy");
- }
- */
// stimulate zipping or not
// we can unzip, and we will return it always as unzipped, unless not wanted
diff --git a/source/de/anomic/plasma/plasmaCrawlWorker.java b/source/de/anomic/plasma/plasmaCrawlWorker.java
index b1b7491fb..a756fdb6e 100644
--- a/source/de/anomic/plasma/plasmaCrawlWorker.java
+++ b/source/de/anomic/plasma/plasmaCrawlWorker.java
@@ -327,9 +327,7 @@ public final class plasmaCrawlWorker extends Thread {
// TODO: resolve yacy and yacyh domains
//String yAddress = yacyCore.seedDB.resolveYacyAddress(host);
- // set referrer; in some case advertise a little bit:
referer = (referer == null) ? "" : referer.trim();
- if (referer.length() == 0) referer = "http://www.yacy.net/yacy/";
// take a file from the net
httpc remote = null;
diff --git a/source/de/anomic/plasma/plasmaGrafics.java b/source/de/anomic/plasma/plasmaGrafics.java
index 93b16f5f7..e2fff3a99 100644
--- a/source/de/anomic/plasma/plasmaGrafics.java
+++ b/source/de/anomic/plasma/plasmaGrafics.java
@@ -106,17 +106,17 @@ public class plasmaGrafics {
}
public static ymagePainter getNetworkPicture(long maxAge) {
- return getNetworkPicture(maxAge, 640, 480, 300, 300, 1000);
+ return getNetworkPicture(maxAge, 640, 480, 300, 300, 1000, true);
}
- public static ymagePainter getNetworkPicture(long maxAge, int width, int height, int passiveLimit, int potentialLimit, int maxCount) {
+ public static ymagePainter getNetworkPicture(long maxAge, int width, int height, int passiveLimit, int potentialLimit, int maxCount, boolean corona) {
if ((networkPicture == null) || ((System.currentTimeMillis() - networkPictureDate) > maxAge)) {
- drawNetworkPicture(width, height, passiveLimit, potentialLimit, maxCount);
+ drawNetworkPicture(width, height, passiveLimit, potentialLimit, maxCount, corona);
}
return networkPicture;
}
- private static void drawNetworkPicture(int width, int height, int passiveLimit, int potentialLimit, int maxCount) {
+ private static void drawNetworkPicture(int width, int height, int passiveLimit, int potentialLimit, int maxCount, boolean corona) {
int innerradius = Math.min(width, height) / 5;
int outerradius = innerradius + innerradius * yacyCore.seedDB.sizeConnected() / 100;
@@ -144,7 +144,7 @@ public class plasmaGrafics {
while (e.hasMoreElements() && count < maxCount) {
seed = (yacySeed) e.nextElement();
if (seed != null) {
- drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, "000040", "608860", "B0FFB0");
+ drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, "000040", "608860", "B0FFB0", corona);
count++;
}
}
@@ -158,7 +158,7 @@ public class plasmaGrafics {
if (seed != null) {
lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenTime()) / 1000 / 60);
if (lastseen > passiveLimit) break; // we have enough, this list is sorted so we don't miss anything
- drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, "101010", "401000", "802000");
+ drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, "101010", "401000", "802000", corona);
count++;
}
}
@@ -172,14 +172,14 @@ public class plasmaGrafics {
if (seed != null) {
lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenTime()) / 1000 / 60);
if (lastseen > potentialLimit) break; // we have enough, this list is sorted so we don't miss anything
- drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, "202000", "505000", "A0A000");
+ drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, seed, "202000", "505000", "A0A000", corona);
count++;
}
}
totalCount += count;
// draw my own peer
- drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, yacyCore.seedDB.mySeed, "800000", "AAAAAA", "FFFFFF");
+ drawNetworkPicturePeer(networkPicture, width / 2, height / 2, innerradius, outerradius, yacyCore.seedDB.mySeed, "800000", "AAAAAA", "FFFFFF", corona);
// draw description
networkPicture.setColor("FFFFFF");
@@ -192,7 +192,7 @@ public class plasmaGrafics {
networkPictureDate = System.currentTimeMillis();
}
- private static void drawNetworkPicturePeer(ymagePainter img, int x, int y, int innerradius, int outerradius, yacySeed seed, String colorDot, String colorLine, String colorText) {
+ private static void drawNetworkPicturePeer(ymagePainter img, int x, int y, int innerradius, int outerradius, yacySeed seed, String colorDot, String colorLine, String colorText, boolean corona) {
String name = seed.getName().toUpperCase();
if (name.length() < shortestName) shortestName = name.length();
if (name.length() > longestName) longestName = name.length();
@@ -212,9 +212,10 @@ public class plasmaGrafics {
// draw text
img.setColor(colorText);
img.arcPrint(x, y, innerradius + linelength, angle, name);
+
// draw corona around dot for crawling activity
int ppm10 = seed.getPPM() / 10;
- if (ppm10 > 0) {
+ if ((corona) && (ppm10 > 0)) {
if (ppm10 > 3) ppm10 = 3;
// draw a wave around crawling peers
long strength;