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