* i2psnark: Don't do a naming lookup for Base64 destkeys

This commit is contained in:
zzz
2008-03-05 14:19:19 +00:00
parent 1ecb84f3fb
commit 71ddfa42e1

View File

@ -206,16 +206,16 @@ public class I2PSnarkUtil {
Destination getDestination(String ip) { Destination getDestination(String ip) {
if (ip == null) return null; if (ip == null) return null;
if (ip.endsWith(".i2p")) { if (ip.endsWith(".i2p")) {
if (ip.length() < 520) { // key + ".i2p"
Destination dest = _context.namingService().lookup(ip); Destination dest = _context.namingService().lookup(ip);
if (dest != null) { if (dest != null)
return dest; return dest;
} else { }
try { try {
return new Destination(ip.substring(0, ip.length()-4)); // sans .i2p return new Destination(ip.substring(0, ip.length()-4)); // sans .i2p
} catch (DataFormatException dfe) { } catch (DataFormatException dfe) {
return null; return null;
} }
}
} else { } else {
try { try {
return new Destination(ip); return new Destination(ip);