mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine code of security deny check
This commit is contained in:
parent
18b15b9099
commit
f89941254a
2 changed files with 6 additions and 6 deletions
|
@ -55,19 +55,19 @@ int SrsSecurity::check(SrsRtmpConnType type, string ip, SrsRequest* req)
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow if matches allow strategy.
|
// allow if matches allow strategy.
|
||||||
if (allow_check(rules, type, ip, req) == ERROR_SYSTEM_SECURITY_ALLOW) {
|
if (allow_check(rules, type, ip) == ERROR_SYSTEM_SECURITY_ALLOW) {
|
||||||
ret = ERROR_SUCCESS;
|
ret = ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// deny if matches deny strategy.
|
// deny if matches deny strategy.
|
||||||
if (deny_check(rules, type, ip, req) == ERROR_SYSTEM_SECURITY_DENY) {
|
if (deny_check(rules, type, ip) == ERROR_SYSTEM_SECURITY_DENY) {
|
||||||
ret = ERROR_SYSTEM_SECURITY_DENY;
|
ret = ERROR_SYSTEM_SECURITY_DENY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req)
|
int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsSecurity::deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req)
|
int SrsSecurity::deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -58,12 +58,12 @@ private:
|
||||||
* security check the allow,
|
* security check the allow,
|
||||||
* @return, if allowed, ERROR_SYSTEM_SECURITY_ALLOW.
|
* @return, if allowed, ERROR_SYSTEM_SECURITY_ALLOW.
|
||||||
*/
|
*/
|
||||||
virtual int allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req);
|
virtual int allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip);
|
||||||
/**
|
/**
|
||||||
* security check the deny,
|
* security check the deny,
|
||||||
* @return, if denied, ERROR_SYSTEM_SECURITY_DENY.
|
* @return, if denied, ERROR_SYSTEM_SECURITY_DENY.
|
||||||
*/
|
*/
|
||||||
virtual int deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req);
|
virtual int deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue