Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-01-02 16:06:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f89941254ac9efb0417d014d1178a6759b5933f3
f8994125
1 parent
18b15b90
refine code of security deny check
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
6 行增加
和
6 行删除
trunk/src/app/srs_app_security.cpp
trunk/src/app/srs_app_security.hpp
trunk/src/app/srs_app_security.cpp
查看文件 @
f899412
...
...
@@ -55,19 +55,19 @@ int SrsSecurity::check(SrsRtmpConnType type, string ip, SrsRequest* req)
}
// 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
;
}
// 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
;
}
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
;
...
...
@@ -109,7 +109,7 @@ int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std:
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
;
...
...
trunk/src/app/srs_app_security.hpp
查看文件 @
f899412
...
...
@@ -58,12 +58,12 @@ private:
* security check the 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,
* @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
...
...
请
注册
或
登录
后发表评论