mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
优化ip过滤逻辑性能
This commit is contained in:
parent
706c63c64b
commit
22e3872cd4
@ -93,8 +93,8 @@ bool HttpFileManager::isIPAllowed(const std::string &ip) {
|
|||||||
if (allow_ip_range.empty()) {
|
if (allow_ip_range.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
auto ip_int = get_ip_uint64(ip);
|
||||||
for (auto &range : allow_ip_range) {
|
for (auto &range : allow_ip_range) {
|
||||||
auto ip_int = get_ip_uint64(ip);
|
|
||||||
if (ip_int >= range.first && ip_int <= range.second) {
|
if (ip_int >= range.first && ip_int <= range.second) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user