Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Connections_p.html: better formatting and remove very old entries
danielr2617f4dcdb1f
diff --git a/.classpath b/.classpathindex c93b44b06..0c728756b 100644--- a/.classpath+++ b/.classpath@@ -38,6 +38,10 @@<classpathentry kind="lib" path="libx/FontBox-0.1.0-dev.jar"/><classpathentry kind="lib" path="libx/bcprov-jdk14-132.jar"/><classpathentry kind="lib" path="libx/commons-codec-1.3.jar"/>- <classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>+ <classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar" sourcepath="doc/commons-httpclient-3.1/src">+ <attributes>+ <attribute name="javadoc_location" value="file:/home/daniel/workspace/yacy/doc/commons-httpclient-3.1/docs/apidocs/"/>+ </attributes>+ </classpathentry><classpathentry kind="output" path="gen"/></classpath>diff --git a/defaults/yacy.init b/defaults/yacy.initindex b15082f0a..1f79da9e3 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -70,7 +70,8 @@ server.maxTrackingTime = 3600000# The property here can also be a url where the definition can be loaded.# In case of privately managed networks, this configuration must be changed BEFORE it is released# to the members of the separated network peers.-network.unit.definition = defaults/yacy.network.freeworld.unit+#network.unit.definition = defaults/yacy.network.freeworld.unit+network.unit.definition = defaults/yacy.network.intranet.unitnetwork.group.definition = defaults/yacy.network.group# Update process propertiesdiff --git a/source/de/anomic/http/HttpConnectionInfo.java b/source/de/anomic/http/HttpConnectionInfo.javaindex c5c1ed4e1..fa75cf664 100644--- a/source/de/anomic/http/HttpConnectionInfo.java+++ b/source/de/anomic/http/HttpConnectionInfo.java@@ -42,6 +42,7 @@ public class HttpConnectionInfo {*/private final static Set<HttpConnectionInfo> allConnections = Collections.synchronizedSet(new HashSet<HttpConnectionInfo>());+ private final static int staleAfterMillis = 1800 * 1000;private final String protocol;private final String targetHost;@@ -143,6 +144,19 @@ public class HttpConnectionInfo {removeConnection(new HttpConnectionInfo(null, null, null, id, 0));}+ /**+ * removes stale connections+ */+ public static void cleanUp() {+ synchronized (allConnections) {+ for(HttpConnectionInfo con: allConnections) {+ if(con.getLifetime() > staleAfterMillis) {+ allConnections.remove(con);+ }+ }+ }+ }+/* (non-Javadoc)* @see java.lang.Object#toString()*/diff --git a/source/de/anomic/http/JakartaCommonsHttpClient.java b/source/de/anomic/http/JakartaCommonsHttpClient.javaindex ea1785c8d..3d1866bd2 100644--- a/source/de/anomic/http/JakartaCommonsHttpClient.java+++ b/source/de/anomic/http/JakartaCommonsHttpClient.java@@ -431,8 +431,9 @@ public class JakartaCommonsHttpClient {} catch (final URIException e) {// should not happen, because method is already executed}- return new HttpConnectionInfo(protocol, (port == 80) ? host : host + ":" + port, method.getName() + " " +- method.getPath() + "?" + method.getQueryString(), method.hashCode(), System.currentTimeMillis());+ final String query = (method.getQueryString() != null) ? "?" + method.getQueryString() : "";+ return new HttpConnectionInfo(protocol, (port == -1 || port == 80) ? host : host + ":" + port, method.getName() + " " ++ method.getPath() + query, method.hashCode(), System.currentTimeMillis());}/**@@ -593,6 +594,7 @@ public class JakartaCommonsHttpClient {lastCleanup = now;conManager.closeIdleConnections(120000);conManager.deleteClosedConnections();+ HttpConnectionInfo.cleanUp();}}}\ No newline at end of filediff --git a/startYACY.sh b/startYACY.shindex ac3527a37..8fb0656b2 100755--- a/startYACY.sh+++ b/startYACY.sh@@ -77,7 +77,7 @@ done#echo $options;exit 0 #DEBUG for getopts#get javastart args-JAVA_ARGS=""+JAVA_ARGS="-ea"if [ ! -f $CONFIGFILE -a -f DATA/SETTINGS/httpProxy.conf ]then# old config if new does not exist