make use of our DNS-cache again - this realy speeds up the lookup

pull/1/head
sixcooler 11 years ago
parent e6d284fe1e
commit 345f9aba27

@ -639,11 +639,11 @@ public class Domains {
host = host.toLowerCase().trim(); host = host.toLowerCase().trim();
// try to simply parse the address // try to simply parse the address
InetAddress ip = InetAddress.getByName(host); // InetAddress ip = InetAddress.getByName(host);
if (ip != null) return ip; // if (ip != null) return ip;
// trying to resolve host by doing a name cache lookup // 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) { if (ip != null) {
cacheHit_Hit++; cacheHit_Hit++;
return ip; return ip;
@ -718,13 +718,13 @@ public class Domains {
final String host = host0.toLowerCase().trim(); final String host = host0.toLowerCase().trim();
// try to simply parse the address // try to simply parse the address
InetAddress ip; InetAddress ip;
try { // try {
ip = InetAddress.getByName(host); // ip = InetAddress.getByName(host);
return ip; // return ip;
} catch (UnknownHostException e1) { // } catch (UnknownHostException e1) {
// we expected that InetAddress.getByName may fail if this is not a raw address. // // we expected that InetAddress.getByName may fail if this is not a raw address.
// We silently ignore this and go on. // // We silently ignore this and go on.
} // }
/* /*
if (MemoryControl.shortStatus()) { if (MemoryControl.shortStatus()) {

Loading…
Cancel
Save