Skip to content

Commit

Permalink
make use of our DNS-cache again - this realy speeds up the lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
sixcooler committed Jan 6, 2014
1 parent e6d284f commit 345f9ab
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/net/yacy/cora/protocol/Domains.java
Expand Up @@ -639,11 +639,11 @@ public static InetAddress dnsResolveFromCache(String host) throws UnknownHostExc
host = host.toLowerCase().trim();

// try to simply parse the address
InetAddress ip = InetAddress.getByName(host);
if (ip != null) return ip;
// InetAddress ip = InetAddress.getByName(host);
// if (ip != null) return ip;

// trying to resolve host by doing a name cache lookup
ip = NAME_CACHE_HIT.get(host);
InetAddress ip = NAME_CACHE_HIT.get(host);
if (ip != null) {
cacheHit_Hit++;
return ip;
Expand Down Expand Up @@ -718,13 +718,13 @@ public static InetAddress dnsResolve(final String host0) {
final String host = host0.toLowerCase().trim();
// try to simply parse the address
InetAddress ip;
try {
ip = InetAddress.getByName(host);
return ip;
} catch (UnknownHostException e1) {
// we expected that InetAddress.getByName may fail if this is not a raw address.
// We silently ignore this and go on.
}
// try {
// ip = InetAddress.getByName(host);
// return ip;
// } catch (UnknownHostException e1) {
// // we expected that InetAddress.getByName may fail if this is not a raw address.
// // We silently ignore this and go on.
// }

/*
if (MemoryControl.shortStatus()) {
Expand Down

0 comments on commit 345f9ab

Please sign in to comment.