diff --git a/defaults/yacy.init b/defaults/yacy.init index 63ee34f4d..5ca48584a 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -174,7 +174,6 @@ httpdMaxBusySessions = 200 # users shall be encouraged to use the htdocs path for individual content, # not this path defined here htRootPath = htroot -htTemplatePath = htroot/env/templates # the htroot path # root path for the httpd file server diff --git a/htroot/AccessTracker_p.java b/htroot/AccessTracker_p.java index 8db723bd8..926e2421a 100644 --- a/htroot/AccessTracker_p.java +++ b/htroot/AccessTracker_p.java @@ -29,12 +29,11 @@ import java.util.Collection; import java.util.ConcurrentModificationException; import java.util.Date; import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TreeSet; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentLinkedQueue; import java.text.SimpleDateFormat; import net.yacy.cora.protocol.Domains; @@ -55,7 +54,7 @@ public class AccessTracker_p { private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US); private static final Collection listclone(final Collection m) { - final List accessClone = new LinkedList(); + final Collection accessClone = new ConcurrentLinkedQueue(); try { accessClone.addAll(m); } catch (final ConcurrentModificationException e) {} diff --git a/htroot/CrawlResults.java b/htroot/CrawlResults.java index a0901ef0c..d5e37280a 100644 --- a/htroot/CrawlResults.java +++ b/htroot/CrawlResults.java @@ -197,8 +197,8 @@ public class CrawlResults { urlstr = metadata.url().toNormalform(false, true); urltxt = nxTools.shortenURLString(urlstr, 72); // shorten the string text like a URL } - initiatorSeed = entry.getValue() == null ? null : sb.peers.getConnected(new String(entry.getValue().initiatorHash)); - executorSeed = entry.getValue() == null ? null : sb.peers.getConnected(new String(entry.getValue().executorHash)); + initiatorSeed = entry.getValue() == null || entry.getValue().initiatorHash == null ? null : sb.peers.getConnected(new String(entry.getValue().initiatorHash)); + executorSeed = entry.getValue() == null || entry.getValue().executorHash == null ? null : sb.peers.getConnected(new String(entry.getValue().executorHash)); prop.put("table_indexed_" + cnt + "_dark", (dark) ? "1" : "0"); prop.put("table_indexed_" + cnt + "_feedbackpage", "CrawlResults.html"); diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index 5a8e0d916..490b1e112 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -99,7 +99,7 @@
  • Deutsches Forum
  • English Forum
  • YaCy Project Wiki
  • -
  • YaCy Statistics
  • +
  • #(newpeer)#Peer Statistics::YaCy Statistics#(/newpeer)#
  • diff --git a/htroot/proxymsg/error.html b/htroot/proxymsg/error.html index 496e149d3..2ccb15555 100644 --- a/htroot/proxymsg/error.html +++ b/htroot/proxymsg/error.html @@ -6,10 +6,10 @@
    -

    YaCy - Distributed Web Indexing - Administration

    +

    YaCy

    -

    Problems with request: #[requestMethod]# #[requestURL]#

    +

    request: #[requestMethod]# #[requestURL]#

    #[httpStatus]#

    #(errorMessageType)#

    unspecified error

    diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.java index a21999ec3..cf17c6beb 100644 --- a/source/de/anomic/http/server/HTTPDFileHandler.java +++ b/source/de/anomic/http/server/HTTPDFileHandler.java @@ -104,6 +104,7 @@ import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.server.servletProperties; import de.anomic.yacy.yacyBuildProperties; +import de.anomic.yacy.yacySeed; import de.anomic.yacy.graphics.EncodedImage; public final class HTTPDFileHandler { @@ -117,7 +118,6 @@ public final class HTTPDFileHandler { private static File htRootPath = null; private static File htDocsPath = null; - private static File htTemplatePath = null; private static String[] defaultFiles = null; private static File htDefaultPath = null; private static File htLocalePath = null; @@ -170,14 +170,6 @@ public final class HTTPDFileHandler { final File repository = new File(htDocsPath, "repository"); if (!repository.exists()) repository.mkdirs(); - // create a htTemplatePath - if (htTemplatePath == null) { - htTemplatePath = theSwitchboard.getAppPath("htTemplatePath","htroot/env/templates"); - if (!(htTemplatePath.exists())) htTemplatePath.mkdir(); - } - //This is now handles by #%env/templates/foo%# - //if (templates.isEmpty()) templates.putAll(httpTemplate.loadTemplates(htTemplatePath)); - // create htLocaleDefault, htLocalePath if (htDefaultPath == null) htDefaultPath = theSwitchboard.getAppPath("htDefaultPath", "htroot"); if (htLocalePath == null) htLocalePath = theSwitchboard.getDataPath("locale.translated_html", "DATA/LOCALE/htroot"); @@ -818,6 +810,9 @@ public final class HTTPDFileHandler { templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTNAME, switchboard.getConfig("peerName", "anomic")); templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTID, ((Switchboard) switchboard).peers.myID()); templatePatterns.put(servletProperties.PEER_STAT_MYTIME, DateFormatter.formatShortSecond()); + yacySeed myPeer = sb.peers.mySeed(); + templatePatterns.put("newpeer", myPeer.getAge() >= 1 ? 0 : 1); + templatePatterns.putHTML("newpeer_peerhash", myPeer.hash); //System.out.println("respond props: " + ((tp == null) ? "null" : tp.toString())); // debug } catch (final InvocationTargetException e) { if (e.getCause() instanceof InterruptedException) { diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java index 7a6136ce1..b7e7b1d39 100644 --- a/source/de/anomic/server/serverCore.java +++ b/source/de/anomic/server/serverCore.java @@ -155,7 +155,9 @@ public final class serverCore extends AbstractBusyThread implements BusyThread { try { Thread.sleep(100); } catch (final InterruptedException ex) {} // trying to interrupt session - s.notify(); + synchronized (s) { + s.notify(); + } s.interrupt(); try {Thread.sleep(10);} catch (final InterruptedException ex) {} diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java index 84922e2ff..1d9a7a50e 100644 --- a/source/net/yacy/kelondro/blob/HeapReader.java +++ b/source/net/yacy/kelondro/blob/HeapReader.java @@ -406,7 +406,12 @@ public class HeapReader { // access the file and read the container file.seek(pos); final int len = file.readInt() - index.row().primaryKeyLength; - if (len < 0) throw new IOException("file " + file.file() + " corrupted at " + pos + ": negative len. len = " + len + ", pk.len = " + index.row().primaryKeyLength); + if (len < 0) { + // database file may be corrupted and should be deleted :-(( + Log.logSevere("HeapReader", "file " + file.file() + " corrupted at " + pos + ": negative len. len = " + len + ", pk.len = " + index.row().primaryKeyLength); + // to get lazy over that problem (who wants to tell the user to stop operation and delete the file???) we work on like the entry does not exist + return null; + } if (MemoryControl.available() < len * 2 + keepFreeMem) { if (!MemoryControl.request(len * 2 + keepFreeMem, true)) throw new RowSpaceExceededException(len * 2 + keepFreeMem, "HeapReader.get()"); // not enough memory available for this blob }