Skip to content

Commit

Permalink
* revert debug change
Browse files Browse the repository at this point in the history
* contains instead of startsWith, because there might me localizied strings
* decode punycode for every domainpart seperately (see http://forum.yacy-websuche.de/viewtopic.php?f=9&t=1749)


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5516 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
f1ori committed Jan 24, 2009
1 parent 5570fa8 commit aaafe05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions source/de/anomic/http/httpdFileHandler.java
Expand Up @@ -1053,9 +1053,9 @@ public static void doResponse(final Properties conProp, final httpRequestHeader
} 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.");
Expand Down
24 changes: 14 additions & 10 deletions source/de/anomic/yacy/yacyURL.java
Expand Up @@ -124,17 +124,21 @@ private void parseURLString(String url) throws MalformedURLException {

// 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) {}
}

Expand Down
2 changes: 1 addition & 1 deletion startYACY.sh
Expand Up @@ -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
Expand Down

0 comments on commit aaafe05

Please sign in to comment.