cache DNS

This commit is contained in:
Michael Save 2012-03-15 14:13:43 +11:00
parent 3179eef338
commit 5abe3ae4b2

View File

@ -1675,8 +1675,8 @@
function DNS($host) { function DNS($host) {
global $config; global $config;
if($config['cache']['enabled'] && ($host = cache::get('dns_' . $host))) { if($config['cache']['enabled'] && ($ip_addr = cache::get('dns_' . $host))) {
return $host; return $ip_addr;
} }
if(!$config['dns_system']) { if(!$config['dns_system']) {
@ -1692,7 +1692,7 @@
} }
if($config['cache']['enabled']) if($config['cache']['enabled'])
cache::set('dns_' . $ip_addr, $host, 3600); cache::set('dns_' . $host, $ip_addr, 3600);
return $host; return $host;
} }