Revert the compare order in check_ip_in_proxy_list

This commit is contained in:
Max Lv
2020-05-07 14:35:32 +08:00
parent e388c354a1
commit ee1fd01698
+8 -14
View File
@@ -311,21 +311,15 @@ impl Context {
// Proxy everything by default
None => true,
Some(ref a) => {
// first check the IP list
if a.check_ip_in_proxy_list(ip) {
true
// do the reverse lookup in our local cache
let mut reverse_lookup_cache = self.reverse_lookup_cache.lock();
// if a qname is found
if let Some(forward) = reverse_lookup_cache.get(ip) {
// if qname is resolved by remote,
// we should proxy it as well
*forward
} else {
// do the reverse lookup in our local cache
let mut reverse_lookup_cache = self.reverse_lookup_cache.lock();
// if a qname is found
if let Some(forward) = reverse_lookup_cache.get(ip) {
// if qname is resolved by remote,
// we should proxy it as well
*forward
} else {
// by default not proxied
false
}
a.check_ip_in_proxy_list(ip)
}
}
}