mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
make use of our DNS-cache again - this realy speeds up the lookup
This commit is contained in:
parent
e6d284fe1e
commit
345f9aba27
|
@ -639,11 +639,11 @@ public class Domains {
|
|||
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;
|
||||
|
@ -718,13 +718,13 @@ public class Domains {
|
|||
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()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user