parent
8cb7831dff
commit
1d7da3354d
|
@ -92,9 +92,6 @@ public class DpTechAbilityImpl implements DisposeAbility {
|
|||
//读取超时
|
||||
policy.setReceiveTimeout(DpTechConfigValue.SOAP_RECEIVE_TIMEOUT_SECOND);
|
||||
conduit.setClient(policy);
|
||||
|
||||
// 获取迪普设备防护IP
|
||||
getDisposeDeviceProtectObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -266,16 +263,33 @@ public class DpTechAbilityImpl implements DisposeAbility {
|
|||
*/
|
||||
@Override
|
||||
public boolean isCarryProtectIp(String ipAddr) {
|
||||
boolean ret = false;
|
||||
IPAddress addr = new IPAddressString(ipAddr).getAddress();
|
||||
synchronized (this) {
|
||||
if (addr.isIPv4()) {
|
||||
return protectIpV4.stream().anyMatch(v -> Helper.ipInRange(v, ipAddr));
|
||||
ret = protectIpV4.stream().anyMatch(v -> Helper.ipInRange(v, ipAddr));
|
||||
}
|
||||
|
||||
if (addr.isIPv6()) {
|
||||
return protectIpV6.stream().anyMatch(v -> Helper.ipInRange(v, ipAddr));
|
||||
ret = protectIpV6.stream().anyMatch(v -> Helper.ipInRange(v, ipAddr));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
if (!ret) {
|
||||
// 更新迪普设备防护IP
|
||||
getDisposeDeviceProtectObject();
|
||||
|
||||
synchronized (this) {
|
||||
if (addr.isIPv4()) {
|
||||
ret = protectIpV4.stream().anyMatch(v -> Helper.ipInRange(v, ipAddr));
|
||||
}
|
||||
|
||||
if (addr.isIPv6()) {
|
||||
ret = protectIpV6.stream().anyMatch(v -> Helper.ipInRange(v, ipAddr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue