Skip to content

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

added new cybertag-tracking feature that was inspired by itgrl from the forum discussion in http://forum.yacy-websuche.de/viewtopic.php?p=12612#p12612

orbiter01b97ef3f80c
diff --git a/.classpath b/.classpath
index c8ae866ba..c57d83ee4 100644
--- a/.classpath
+++ b/.classpath
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="env/|htdocsdefault/|proxymsg/|yacy/|env/|yacy/user/|yacy/user/|yacy/ui/|processing/domaingraph/applet/|processing/domaingraph/|api/|api/bookmarks/posts/|api/bookmarks/|api/util/|api/bookmarks/xbel/|api/bookmarks/tags/" kind="src" path="htroot"/>
- <classpathentry excluding="user/|user/|ui/" kind="src" path="htroot/yacy"/>
- <classpathentry kind="src" path="htroot/env"/>
- <classpathentry kind="src" path="source"/>
- <classpathentry kind="src" path="htroot/yacy/ui"/>
- <classpathentry excluding="bookmarks/posts/|bookmarks/|util/|bookmarks/xbel/|bookmarks/tags/" kind="src" path="htroot/api"/>
- <classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
- <classpathentry excluding="posts/|xbel/|tags/" kind="src" path="htroot/api/bookmarks"/>
- <classpathentry kind="src" path="htroot/api/util"/>
- <classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
- <classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="lib/tar.jar"/>
- <classpathentry kind="lib" path="libx/bzip2.jar"/>
- <classpathentry kind="lib" path="libx/commons-discovery.jar"/>
- <classpathentry kind="lib" path="libx/commons-jxpath-1.1.jar"/>
- <classpathentry kind="lib" path="libx/jakarta-oro-2.0.7.jar"/>
- <classpathentry kind="lib" path="libx/jaxrpc.jar"/>
- <classpathentry kind="lib" path="libx/jmimemagic-0.1.0.jar"/>
- <classpathentry kind="lib" path="libx/jrpm-head.jar"/>
- <classpathentry kind="lib" path="libx/jrpm-SNAPSHOT.jar"/>
- <classpathentry kind="lib" path="libx/jsch-0.1.21.jar"/>
- <classpathentry kind="lib" path="libx/log4j-1.2.9.jar"/>
- <classpathentry kind="lib" path="libx/odf_utils_05_11_29.jar"/>
- <classpathentry kind="lib" path="libx/sbbi-upnplib-1.0.3.jar"/>
- <classpathentry kind="lib" path="libx/tm-extractors-1.0.jar"/>
- <classpathentry kind="lib" path="libx/wsdl4j.jar"/>
- <classpathentry kind="lib" path="libx/xerces.jar"/>
- <classpathentry kind="lib" path="libx/poi-3.0-alpha2-20060616.jar"/>
- <classpathentry kind="lib" path="libx/poi-scratchpad-3.0-alpha2-20060616.jar"/>
- <classpathentry kind="lib" path="libx/inetlib.jar"/>
- <classpathentry kind="lib" path="libx/gnumail.jar"/>
- <classpathentry kind="lib" path="libx/activation.jar"/>
- <classpathentry kind="lib" path="libx/webcat-0.1-swf.jar"/>
- <classpathentry kind="lib" path="libx/J7Zip-modified.jar"/>
- <classpathentry kind="lib" path="libx/PDFBox-0.7.3.jar"/>
- <classpathentry kind="lib" path="libx/FontBox-0.1.0-dev.jar"/>
- <classpathentry kind="lib" path="libx/bcprov-jdk14-139.jar"/>
- <classpathentry kind="lib" path="libx/bcmail-jdk14-139.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-logging-1.1.1.jar"/>
- <classpathentry kind="lib" path="lib/commons-io-1.4.jar"/>
- <classpathentry kind="lib" path="lib/commons-fileupload-1.2.1.jar"/>
- <classpathentry kind="lib" path="lib/servlet-api.jar"/>
- <classpathentry kind="output" path="gen"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry excluding="env/|htdocsdefault/|proxymsg/|yacy/|env/|yacy/user/|yacy/user/|yacy/ui/|processing/domaingraph/applet/|processing/domaingraph/|api/|api/bookmarks/posts/|api/bookmarks/|api/util/|api/bookmarks/xbel/|api/bookmarks/tags/" kind="src" path="htroot"/>
+ <classpathentry excluding="user/|user/|ui/" kind="src" path="htroot/yacy"/>
+ <classpathentry kind="src" path="htroot/env"/>
+ <classpathentry kind="src" path="source"/>
+ <classpathentry kind="src" path="htroot/yacy/ui"/>
+ <classpathentry excluding="bookmarks/posts/|bookmarks/|util/|bookmarks/xbel/|bookmarks/tags/" kind="src" path="htroot/api"/>
+ <classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
+ <classpathentry excluding="posts/|xbel/|tags/" kind="src" path="htroot/api/bookmarks"/>
+ <classpathentry kind="src" path="htroot/api/util"/>
+ <classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
+ <classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="lib/tar.jar"/>
+ <classpathentry kind="lib" path="libx/bzip2.jar"/>
+ <classpathentry kind="lib" path="libx/commons-discovery.jar"/>
+ <classpathentry kind="lib" path="libx/commons-jxpath-1.1.jar"/>
+ <classpathentry kind="lib" path="libx/jakarta-oro-2.0.7.jar"/>
+ <classpathentry kind="lib" path="libx/jaxrpc.jar"/>
+ <classpathentry kind="lib" path="libx/jmimemagic-0.1.0.jar"/>
+ <classpathentry kind="lib" path="libx/jrpm-head.jar"/>
+ <classpathentry kind="lib" path="libx/jrpm-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="libx/jsch-0.1.21.jar"/>
+ <classpathentry kind="lib" path="libx/log4j-1.2.9.jar"/>
+ <classpathentry kind="lib" path="libx/odf_utils_05_11_29.jar"/>
+ <classpathentry kind="lib" path="libx/sbbi-upnplib-1.0.3.jar"/>
+ <classpathentry kind="lib" path="libx/tm-extractors-1.0.jar"/>
+ <classpathentry kind="lib" path="libx/wsdl4j.jar"/>
+ <classpathentry kind="lib" path="libx/xerces.jar"/>
+ <classpathentry kind="lib" path="libx/poi-3.0-alpha2-20060616.jar"/>
+ <classpathentry kind="lib" path="libx/poi-scratchpad-3.0-alpha2-20060616.jar"/>
+ <classpathentry kind="lib" path="libx/inetlib.jar"/>
+ <classpathentry kind="lib" path="libx/gnumail.jar"/>
+ <classpathentry kind="lib" path="libx/activation.jar"/>
+ <classpathentry kind="lib" path="libx/webcat-0.1-swf.jar"/>
+ <classpathentry kind="lib" path="libx/J7Zip-modified.jar"/>
+ <classpathentry kind="lib" path="libx/PDFBox-0.7.3.jar"/>
+ <classpathentry kind="lib" path="libx/FontBox-0.1.0-dev.jar"/>
+ <classpathentry kind="lib" path="libx/bcprov-jdk14-139.jar"/>
+ <classpathentry kind="lib" path="libx/bcmail-jdk14-139.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-logging-1.1.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-io-1.4.jar"/>
+ <classpathentry kind="lib" path="lib/commons-fileupload-1.2.1.jar"/>
+ <classpathentry kind="lib" path="lib/servlet-api.jar"/>
+ <classpathentry kind="output" path="gen"/>
+</classpath>
diff --git a/build.xml b/build.xml
index a2b3aa334..1de828c63 100644
--- a/build.xml
+++ b/build.xml
@@ -184,7 +184,7 @@
<pathelement location="${build}" />
<pathelement location="${htroot}" />
- <!-- libs needed for the yacy thread/object-pools -->
+ <!-- standard libs -->
<pathelement location="${lib}/tar.jar" />
<pathelement location="${lib}/commons-fileupload-1.2.1.jar" />
<pathelement location="${lib}/commons-httpclient-3.1.jar" />
diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html
index 1f1a403fb..c60f32407 100644
--- a/htroot/ConfigBasic.html
+++ b/htroot/ConfigBasic.html
@@ -25,7 +25,7 @@
Your YaCy Peer needs some basic information to operate properly
</p>
- <form action="ConfigBasic.html" method="post" enctype="multipart/form-data">
+ <form action="ConfigBasic.html" method="get">
<ol>
<li>
<img src="/env/grafics/ok.png" height="16" width="16" alt="ok" />&nbsp;Select a language for the interface:<br />
@@ -53,7 +53,8 @@
<tr>
<td><label for="usecaseFreeworld">join and support the global network 'freeworld', search the web with an uncensored user-owned search network</label></td>
<td><label for="usecasePortal">your YaCy installation behaves independently from other peers and you define your own web index by starting your own web crawl. This can be used to search your own web pages or to define a topic-oriented search portal.</label></td>
- <td><label for="usecaseIntranet">create a search portal for your intranet web pages, or pages that are placed at DATA/HTDOCS/repository and can be accessed at <a href="http://localhost:#[port]#/repository/">http://localhost:#[port]#/repository</a></label></td>
+ <td><label for="usecaseIntranet">create a search portal for your intranet web pages, or pages that are placed at DATA/HTDOCS/repository and can be accessed at <a href="http://localhost:#[port]#/repository/">http://localhost:#[port]#/repository</a></label>
+ <input type="file" name="repository" size="10" value="/DATA/HTROOT/repositry"></td>
</tr>
</table>
</fieldset>
diff --git a/htroot/Trails.html b/htroot/Trails.html
new file mode 100644
index 000000000..befd1a2c1
--- /dev/null
+++ b/htroot/Trails.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CyTag Trails</title>
+ #%env/templates/metas.template%#
+<script language="Javascript">
+function search() {
+ var xmlHttpReq = false;
+ var self = this;
+ if (window.XMLHttpRequest) { // Mozilla/Safari
+ self.xmlHttpReq = new XMLHttpRequest();
+ }
+ else if (window.ActiveXObject) { // IE
+ self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ self.xmlHttpReq.open('GET', "api/trail_p.json", true);
+ self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ self.xmlHttpReq.onreadystatechange = function() {
+ if (self.xmlHttpReq.readyState == 4) {
+ updatepage(self.xmlHttpReq.responseText);
+ }
+ }
+ self.xmlHttpReq.send(null);
+}
+
+function updatepage(str) {
+ var rsp = eval("("+str+")");
+ var trails = rsp.trails;
+
+ var html = "";
+
+ var item;
+ html += "<table class=\"networkTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">";
+ html += "<tr class=\"TableHeader\" valign=\"bottom\">";
+ html += "<td>time</td>";
+ html += "<td>trail</td>";
+ html += "<td>nick</td>";
+ html += "<td>tag</td>";
+ html += "<td>icon</td>";
+ html += "<td>ip</td>";
+ html += "<td>agent</td></tr>";
+ for (var i = 0; i < trails.length; i++) {
+ item = trails[i];
+ if (item.time == null) break;
+ html += "<tr class=\"TableCellLight\"><td>"+ item.time + "</td>";
+ html += "<td>" + item.trail + "</td>";
+ html += "<td>" + item.nick + "</td>";
+ html += "<td>" + item.tag + "</td>";
+ html += "<td>" + item.icon + "</td>";
+ html += "<td>" + item.ip + "</td>";
+ html += "<td>" + item.agent + "</td></tr>";
+ }
+ html += "</table>";
+ document.getElementById("trails").innerHTML = html;
+}
+</script>
+</head>
+<body>
+#%env/templates/header.template%#
+<script type="text/javascript">
+search();
+</script>
+<div id="trails"></div>
+
+#%env/templates/footer.template%#
+</body>
+</html>
\ No newline at end of file
diff --git a/htroot/Trails.java b/htroot/Trails.java
new file mode 100644
index 000000000..07ffc728b
--- /dev/null
+++ b/htroot/Trails.java
@@ -0,0 +1,13 @@
+import de.anomic.http.httpRequestHeader;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+import de.anomic.server.servletProperties;
+
+//dummy class
+public class Trails {
+
+ public static servletProperties respond(final httpRequestHeader requestHeader, final serverObjects post, final serverSwitch<?> env) {
+ final servletProperties prop = new servletProperties();
+ return prop;
+ }
+}
diff --git a/htroot/api/trail_p.java b/htroot/api/trail_p.java
new file mode 100644
index 000000000..f56f880a3
--- /dev/null
+++ b/htroot/api/trail_p.java
@@ -0,0 +1,47 @@
+// trail_p.java
+// (C) 2009 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
+// first published 06.02.2009 on http://www.yacy.net
+//
+// This is a part of YaCy.
+// The Software shall be used for Good, not Evil.
+//
+// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
+// $LastChangedRevision: 1986 $
+// $LastChangedBy: orbiter $
+//
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import de.anomic.http.httpRequestHeader;
+import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public class trail_p {
+
+ public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
+ final plasmaSwitchboard sb = (plasmaSwitchboard) env;
+ final serverObjects prop = new serverObjects();
+
+ int c = 0;
+ for (String t: sb.trail) {
+ prop.put("trails_" + c++ + "_trail", t); // don't put in putHTML or putXML in, this is wrong!
+ }
+ prop.put("trails", c);
+ return prop;
+ }
+
+}
diff --git a/htroot/api/trail_p.json b/htroot/api/trail_p.json
new file mode 100644
index 000000000..fbb1d9c32
--- /dev/null
+++ b/htroot/api/trail_p.json
@@ -0,0 +1,8 @@
+{
+ "trails": [
+#{trails}#
+#[trail]#,
+#{/trails}#
+{}
+ ]
+}
\ No newline at end of file
diff --git a/htroot/cytag.java b/htroot/cytag.java
new file mode 100644
index 000000000..ce382b8b4
--- /dev/null
+++ b/htroot/cytag.java
@@ -0,0 +1,89 @@
+// cytag.java
+// (C) 2009 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
+// first published 06.02.2009 on http://www.yacy.net
+//
+// This is a part of YaCy.
+// The Software shall be used for Good, not Evil.
+//
+// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
+// $LastChangedRevision: 1986 $
+// $LastChangedBy: orbiter $
+//
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import java.awt.Image;
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+
+import de.anomic.htmlFilter.htmlFilterCharacterCoding;
+import de.anomic.http.httpRequestHeader;
+import de.anomic.kelondro.order.DateFormatter;
+import de.anomic.kelondro.util.FileUtils;
+import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+import de.anomic.ymage.ymageImageParser;
+
+public class cytag {
+
+ public static Image respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
+
+ final plasmaSwitchboard sb = (plasmaSwitchboard)env;
+
+ // harvest request information
+ StringBuilder connect = new StringBuilder();
+ connect.append('{');
+ addJSON(connect, "time", DateFormatter.formatShortMilliSecond(new Date()));
+ addJSON(connect, "trail", header.get("Referer", ""));
+ addJSON(connect, "nick", (post == null) ? "" : post.get("nick", ""));
+ addJSON(connect, "tag", (post == null) ? "" : post.get("tag", ""));
+ addJSON(connect, "icon", (post == null) ? "" : post.get("icon", ""));
+ addJSON(connect, "ip", header.get("CLIENTIP", ""));
+ addJSON(connect, "agent", header.get("User-Agent", ""));
+ connect.append('}');
+
+ sb.trail.add(connect.toString());
+ //Log.logInfo("CYTAG", "catched trail - " + connect.toString());
+
+ String defaultimage = "redpillmini.png";
+ if (post != null && post.get("icon", "").equals("invisible")) defaultimage = "invisible.png";
+ File iconfile = new File(sb.getRootPath(), "/htroot/env/grafics/" + defaultimage);
+
+ byte[] imgb = null;
+ try {
+ imgb = FileUtils.read(iconfile);
+ } catch (final IOException e) {
+ return null;
+ }
+ if (imgb == null) return null;
+
+ // read image
+ final Image image = ymageImageParser.parse("cytag.png", imgb);
+
+ return image;
+ }
+
+ private static final void addJSON(StringBuilder sb, String k, String v) {
+ if (sb.length() > 2) sb.append(',');
+ sb.append('\"');
+ sb.append(k);
+ sb.append("\":\"");
+ sb.append(htmlFilterCharacterCoding.unicode2xml(v, true));
+ sb.append('\"');
+ }
+}
diff --git a/htroot/env/grafics/invisible.png b/htroot/env/grafics/invisible.png
new file mode 100644
index 000000000..91433addf
Binary files /dev/null and b/htroot/env/grafics/invisible.png differ
diff --git a/htroot/env/grafics/mcemailh.gif b/htroot/env/grafics/mcemailh.gif
deleted file mode 100644
index 7f63a4c41..000000000
Binary files a/htroot/env/grafics/mcemailh.gif and /dev/null differ
diff --git a/htroot/env/grafics/redpillmini.png b/htroot/env/grafics/redpillmini.png
new file mode 100644
index 000000000..7cb8bf2f5
Binary files /dev/null and b/htroot/env/grafics/redpillmini.png differ
diff --git a/htroot/index.html b/htroot/index.html
index 4f0fde45f..3eb32cb9c 100644
--- a/htroot/index.html
+++ b/htroot/index.html
@@ -133,5 +133,6 @@
::
#%env/templates/embeddedfooter.template%#
#(/display)#
+ <img src="cytag.png?icon=invisible&nick=yacyh_#[clientid]#&tag=search">
</body>
</html>
diff --git a/source/de/anomic/http/httpHeader.java b/source/de/anomic/http/httpHeader.java
index 760801674..bf32cb33a 100644
--- a/source/de/anomic/http/httpHeader.java
+++ b/source/de/anomic/http/httpHeader.java
@@ -277,14 +277,14 @@ public class httpHeader extends TreeMap<String, String> implements Map<String, S
}
// a convenience method to access the map with fail-over defaults
- public Object get(final Object key, final Object dflt) {
- final Object result = get(key);
+ public String get(final String key, final String dflt) {
+ final String result = get(key);
if (result == null) return dflt;
return result;
}
// return multiple results
- public Object getSingle(final Object key, final int count) {
+ public String getSingle(final String key, final int count) {
if (count == 0) return get(key, null);
return get("*" + key + "-" + count, null);
}
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java
index bd7fee6a0..605200644 100644
--- a/source/de/anomic/http/httpd.java
+++ b/source/de/anomic/http/httpd.java
@@ -106,7 +106,7 @@ public final class httpd implements serverHandler, Cloneable {
//TODO: Load this from a file
private static final HashSet<String> disallowZippedContentEncoding = new HashSet<String>(Arrays.asList(new String[]{
- ".gz", ".tgz", ".jpg", ".jpeg", ".gif", ".zip", ".rar", ".bz2", ".lha", ".jar", ".rpm", ".arc", ".arj", ".wmv", ".png", ".ico", ".bmp"
+ ".gz", ".tgz", ".jpg", ".jpeg", ".png", ".mp3", ".mov", ".avi", ".gif", ".zip", ".rar", ".bz2", ".lha", ".jar", ".rpm", ".arc", ".arj", ".wmv", ".ico", ".bmp"
}));
// static objects
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java
index de7ddc91c..5c5cd74f7 100644
--- a/source/de/anomic/http/httpdFileHandler.java
+++ b/source/de/anomic/http/httpdFileHandler.java
@@ -787,6 +787,7 @@ public final class httpdFileHandler {
templatePatterns.put(servletProperties.PEER_STAT_VERSION, switchboard.getConfig("version", ""));
templatePatterns.put(servletProperties.PEER_STAT_UPTIME, ((System.currentTimeMillis() - serverCore.startupTime) / 1000) / 60); // uptime in minutes
templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTNAME, switchboard.getConfig("peerName", "anomic"));
+ templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTID, ((plasmaSwitchboard) switchboard).webIndex.seedDB.myID());
templatePatterns.put(servletProperties.PEER_STAT_MYTIME, DateFormatter.formatShortSecond());
//System.out.println("respond props: " + ((tp == null) ? "null" : tp.toString())); // debug
} catch (final InvocationTargetException e) {
@@ -972,8 +973,8 @@ public final class httpdFileHandler {
// write the file to the client
targetDate = new Date(targetFile.lastModified());
final long contentLength = (zipContent)?-1:targetFile.length()-rangeStartOffset;
- final String contentEncoding = (zipContent)?"gzip":null;
- final String transferEncoding = (!httpVersion.equals(httpHeader.HTTP_VERSION_1_1))?null:(zipContent)?"chunked":null;
+ final String contentEncoding = (zipContent) ? "gzip" : null;
+ final String transferEncoding = (httpVersion.equals(httpHeader.HTTP_VERSION_1_1) && zipContent) ? "chunked" : null;
if (!httpVersion.equals(httpHeader.HTTP_VERSION_1_1) && zipContent) forceConnectionClose(conProp);
httpd.sendRespondHeader(conProp, out, httpVersion, statusCode, null, mimeType, contentLength, targetDate, null, header, contentEncoding, transferEncoding, nocache);
@@ -1026,7 +1027,7 @@ public final class httpdFileHandler {
} catch (final Exception e) {
try {
// doing some errorhandling ...
- e.printStackTrace();
+ //e.printStackTrace();
int httpStatusCode = 400;
final String httpStatusText = null;
final StringBuilder errorMessage = new StringBuilder(2000);
diff --git a/source/de/anomic/kelondro/order/DateFormatter.java b/source/de/anomic/kelondro/order/DateFormatter.java
index a221ee771..9703f0627 100644
--- a/source/de/anomic/kelondro/order/DateFormatter.java
+++ b/source/de/anomic/kelondro/order/DateFormatter.java
@@ -323,6 +323,11 @@ public final class DateFormatter {
return format(FORMAT_SHORT_SECOND, date);
}
+ public static String formatShortMilliSecond(final Date date) {
+ return format(FORMAT_SHORT_MILSEC, date);
+ }
+
+
/**
* Identical to {@link #formatShortDay(Date, TimeZone)}, but for short second format.
*/
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 21d92f57a..bed911d32 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -236,6 +236,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
public URLLicense licensedURLs;
public Timer moreMemory;
public List<Pattern> networkWhitelist, networkBlacklist;
+ public List<String> trail;
public serverProcessor<indexingQueueEntry> indexingDocumentProcessor;
public serverProcessor<indexingQueueEntry> indexingCondensementProcessor;
@@ -270,6 +271,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
// remote proxy configuration
httpRemoteProxyConfig.init(this);
+ this.trail = new ArrayList<String>();
+
// load values from configs
this.plasmaPath = getConfigPath(plasmaSwitchboardConstants.PLASMA_PATH, plasmaSwitchboardConstants.PLASMA_PATH_DEFAULT);
this.log.logConfig("Plasma DB Path: " + this.plasmaPath.toString());
diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java
index f1a0f50db..97aa21365 100644
--- a/source/de/anomic/server/serverCore.java
+++ b/source/de/anomic/server/serverCore.java
@@ -645,9 +645,6 @@ public final class serverCore extends serverAbstractBusyThread implements server
this.in.close();
this.out.close();
- // sleep for a while
- //try {Thread.sleep(500);} catch (final InterruptedException e) {}
-
// close everything
this.controlSocket.close();
diff --git a/source/de/anomic/server/servletProperties.java b/source/de/anomic/server/servletProperties.java
index 62ea97f5d..3fdbb8d01 100644
--- a/source/de/anomic/server/servletProperties.java
+++ b/source/de/anomic/server/servletProperties.java
@@ -34,6 +34,7 @@ public class servletProperties extends serverObjects {
public static final String PEER_STAT_UPTIME = "uptime";
public static final String PEER_STAT_MYTIME = "mytime";
public static final String PEER_STAT_CLIENTNAME = "clientname";
+ public static final String PEER_STAT_CLIENTID = "clientid";
private String prefix="";