Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix unresolved_pattern on missing post parameter api/message.html
regerd3df8a46c426
diff --git a/htroot/yacy/message.java b/htroot/yacy/message.javaindex 9f46515d4..59a07e3ca 100644--- a/htroot/yacy/message.java+++ b/htroot/yacy/message.java@@ -59,11 +59,15 @@ public final class message {}public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {- if (post == null || env == null) { return null; }// return variable that accumulates replacementsfinal Switchboard sb = (Switchboard) env;final serverObjects prop = new serverObjects();++ prop.put("messagesize", "0");+ prop.put("attachmentsize", "0");+ prop.put("response", "-1"); // request rejected+if ((post == null) || (env == null)) return prop;if (!Protocol.authentifyRequest(post, env)) return prop;@@ -74,22 +78,17 @@ public final class message {final int messagesize = 10240;final int attachmentsize = 0;- prop.put("messagesize", "0");- prop.put("attachmentsize", "0");-final String youare = post.get("youare", ""); // seed hash of the target peer, needed for network stability// check if we are the right target and requester has correct information about this peerif ((sb.peers.mySeed() == null) || (!(sb.peers.mySeed().hash.equals(youare)))) {// this request has a wrong target- prop.put("response", "-1"); // request rejectedreturn prop;}- if ((sb.isRobinsonMode()) &&- (!((sb.isPublicRobinson()) ||- (sb.isInMyCluster(header.getRemoteAddr()))))) {+ if ((sb.isRobinsonMode())+ && (!((sb.isPublicRobinson())+ || (sb.isInMyCluster(header.getRemoteAddr()))))) {// if we are a robinson cluster, answer only if this client is known by our network definition- prop.put("response", "-1"); // request rejectedreturn prop;}@@ -107,7 +106,7 @@ public final class message {// post: post message to message boardfinal String otherSeedString = post.get("myseed", "");if (otherSeedString.isEmpty()) {- prop.put("response", "-1"); // request rejected+ // request rejectedreturn prop;}//Date remoteTime = yacyCore.parseUniversalDate((String) post.get(yacySeed.MYTIME)); // read remote time@@ -115,20 +114,20 @@ public final class message {try {otherSeed = Seed.genRemoteSeed(otherSeedString, false, ias == null ? null : ias.getHostAddress());} catch (final IOException e) {- prop.put("response", "-1"); // don't accept messages for bad seeds+ // don't accept messages for bad seedsreturn prop;}String subject = crypt.simpleDecode(post.get("subject", "")); // message's subjectString message = crypt.simpleDecode(post.get("message", "")); // message bodyif (subject == null || message == null) {- prop.put("response", "-1"); // don't accept empty messages+ // don't accept empty messagesreturn prop;}message = message.trim();subject = subject.trim();if (subject.isEmpty() || message.isEmpty()) {- prop.put("response", "-1"); // don't accept empty messages+ // don't accept empty messagesreturn prop;}@@ -156,7 +155,6 @@ public final class message {}}-// System.out.println("respond = " + prop.toString());// return rewrite propertiesreturn prop;