Connections_p.html: better formatting and remove very old entries

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4684 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
danielr 17 years ago
parent 82bf9ac1c8
commit 2617f4dcdb

@ -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>

@ -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.unit
network.group.definition = defaults/yacy.network.group
# Update process properties

@ -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()
*/

@ -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();
}
}
}

@ -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

Loading…
Cancel
Save