mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
* revert debug change
* 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
This commit is contained in:
parent
5570fa817b
commit
aaafe05c02
|
@ -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.");
|
||||
|
|
|
@ -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) {}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user