* i2psnark: Don't do a naming lookup for Base64 destkeys
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user