mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 18:50:20 +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()) {
|
||||
return true;
|
||||
}
|
||||
auto ip_int = get_ip_uint64(ip);
|
||||
for (auto &range : allow_ip_range) {
|
||||
auto ip_int = get_ip_uint64(ip);
|
||||
if (ip_int >= range.first && ip_int <= range.second) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user