From fcec40fcc6d05186cb881ee7f2036124f5cb0594 Mon Sep 17 00:00:00 2001 From: theli Date: Fri, 19 May 2006 11:57:17 +0000 Subject: [PATCH] *) don't accept messages without subject or payload See: http://www.yacy-forum.de/viewtopic.php?p=21656 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2115 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacy/message.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htroot/yacy/message.java b/htroot/yacy/message.java index 94b52d74e..b941dfecb 100644 --- a/htroot/yacy/message.java +++ b/htroot/yacy/message.java @@ -121,8 +121,15 @@ public final class message { yacySeed otherSeed = yacySeed.genRemoteSeed(otherSeedString, key, true); String subject = crypt.simpleDecode(post.get("subject", ""), key); // message's subject + subject = subject.trim(); String message = crypt.simpleDecode(post.get("message", ""), key); // message body - + message = message.trim(); + + if (subject.length() == 0 && message.length() == 0) { + prop.put("response", "-1"); // don't accept empty messages + return prop; + } + prop.put("response", "Thank you!"); // save message