diff options
| -rw-r--r-- | source/de/anomic/http/httpdFileHandler.java | 6 | ||||
| -rw-r--r-- | source/de/anomic/yacy/yacyURL.java | 24 | ||||
| -rwxr-xr-x | startYACY.sh | 2 |
3 files changed, 18 insertions, 14 deletions
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index 76fbb399a..1b60fe289 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -1053,9 +1053,9 @@ public final class httpdFileHandler { } else {
if ((errorMsg != null) &&
(
- errorMsg.startsWith("Broken pipe") ||
- errorMsg.startsWith("Connection reset") ||
- errorMsg.startsWith("Software caused connection abort")
+ errorMsg.contains("broken pipe") ||
+ errorMsg.contains("Connection reset") ||
+ errorMsg.contains("Software caused connection abort")
)) {
// client closed the connection, so we just end silently
errorMessage.append("Client unexpectedly closed connection while processing query.");
diff --git a/source/de/anomic/yacy/yacyURL.java b/source/de/anomic/yacy/yacyURL.java index 994abdf53..96c41cdd1 100644 --- a/source/de/anomic/yacy/yacyURL.java +++ b/source/de/anomic/yacy/yacyURL.java @@ -124,17 +124,21 @@ public class yacyURL implements Serializable { // handle international domains if (!Punycode.isBasic(host)) try { - final int d1 = host.lastIndexOf('.'); - if (d1 >= 0) { - final String tld = host.substring(d1 + 1); - final String dom = host.substring(0, d1); - final int d0 = dom.lastIndexOf('.'); - if (d0 >= 0) { - host = dom.substring(0, d0) + ".xn--" + Punycode.encode(dom.substring(d0 + 1)) + "." + tld; - } else { - host = "xn--" + Punycode.encode(dom) + "." + tld; - } + final String[] domainParts = host.split("\\."); + StringBuilder buffer = new StringBuilder(); + // encode each domainpart seperately + for(int i=0; i<domainParts.length; i++) { + final String part = domainParts[i]; + if(!Punycode.isBasic(part)) { + buffer.append("xn--" + Punycode.encode(part)); + } else { + buffer.append(part); + } + if(i != domainParts.length-1) { + buffer.append('.'); + } } + host = buffer.toString(); } catch (final PunycodeException e) {} } diff --git a/startYACY.sh b/startYACY.sh index f78f2af61..87ff4e2ef 100755 --- a/startYACY.sh +++ b/startYACY.sh @@ -166,7 +166,7 @@ fi CLASSPATH="" for N in lib/*.jar; do CLASSPATH="$CLASSPATH$N:"; done for N in libx/*.jar; do CLASSPATH="$CLASSPATH$N:"; done -CLASSPATH="classes:.:htroot:htroot/api:$CLASSPATH" +CLASSPATH="classes:.:htroot:$CLASSPATH" cmdline="$JAVA $JAVA_ARGS -Djava.awt.headless=true -classpath $CLASSPATH yacy"; if [ $DEBUG -eq 1 ] #debug |
