From 2aa6f978c23511e769345bdbf3a479b66d720d54 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sat, 23 Dec 2006 01:54:28 +0000 Subject: [PATCH] fix for http://www.yacy-forum.de/viewtopic.php?p=29125#29125 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3129 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacysearch.java | 4 ++-- source/de/anomic/yacy/yacyClient.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 685b67ab9..5e4c9067c 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -89,7 +89,8 @@ public class yacysearch { // case if no values are requested final String referer = (String) header.get("Referer"); - if (post == null || env == null) { + String querystring = (post == null) ? "" : post.get("search", "").trim(); + if ((post == null) || (env == null) || (querystring.length() == 0)) { // save referrer // System.out.println("HEADER=" + header.toString()); @@ -138,7 +139,6 @@ public class yacysearch { // collect search attributes int maxDistance = Integer.MAX_VALUE; - String querystring = post.get("search", "").trim(); if ((querystring.length() > 2) && (querystring.charAt(0) == '"') && (querystring.charAt(querystring.length() - 1) == '"')) { querystring = querystring.substring(1, querystring.length() - 1).trim(); maxDistance = 1; diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.java index 3066ba349..e876eca06 100644 --- a/source/de/anomic/yacy/yacyClient.java +++ b/source/de/anomic/yacy/yacyClient.java @@ -571,7 +571,7 @@ public final class yacyClient { } catch (NumberFormatException e) { searchtime = totalrequesttime; } - yacyCore.log.logFine("SEARCH " + results + " URLS FROM " + targetPeer.hash + ":" + targetPeer.getName() + ", score=" + targetPeer.selectscore + ", DHTdist=" + yacyDHTAction.dhtDistance(targetPeer.hash, wordhashes.substring(0, 12)) + ", duetime=" + duetime + ", searchtime=" + searchtime + ", netdelay=" + (totalrequesttime - searchtime) + ", references=" + result.get("references")); + yacyCore.log.logFine("SEARCH " + results + " URLS FROM " + targetPeer.hash + ":" + targetPeer.getName() + ", score=" + targetPeer.selectscore + ", DHTdist=" + ((wordhashes.length() < 12) ? "void" : Double.toString(yacyDHTAction.dhtDistance(targetPeer.hash, wordhashes.substring(0, 12)))) + ", duetime=" + duetime + ", searchtime=" + searchtime + ", netdelay=" + (totalrequesttime - searchtime) + ", references=" + result.get("references")); return urls; } catch (Exception e) { yacyCore.log.logSevere("yacyClient.search error: '" + targetPeer.get(yacySeed.NAME, "anonymous") + "' failed - " + e);