winlin

refine code of security deny check

@@ -55,19 +55,19 @@ int SrsSecurity::check(SrsRtmpConnType type, string ip, SrsRequest* req) @@ -55,19 +55,19 @@ int SrsSecurity::check(SrsRtmpConnType type, string ip, SrsRequest* req)
55 } 55 }
56 56
57 // allow if matches allow strategy. 57 // allow if matches allow strategy.
58 - if (allow_check(rules, type, ip, req) == ERROR_SYSTEM_SECURITY_ALLOW) { 58 + if (allow_check(rules, type, ip) == ERROR_SYSTEM_SECURITY_ALLOW) {
59 ret = ERROR_SUCCESS; 59 ret = ERROR_SUCCESS;
60 } 60 }
61 61
62 // deny if matches deny strategy. 62 // deny if matches deny strategy.
63 - if (deny_check(rules, type, ip, req) == ERROR_SYSTEM_SECURITY_DENY) { 63 + if (deny_check(rules, type, ip) == ERROR_SYSTEM_SECURITY_DENY) {
64 ret = ERROR_SYSTEM_SECURITY_DENY; 64 ret = ERROR_SYSTEM_SECURITY_DENY;
65 } 65 }
66 66
67 return ret; 67 return ret;
68 } 68 }
69 69
70 -int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req) 70 +int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip)
71 { 71 {
72 int ret = ERROR_SUCCESS; 72 int ret = ERROR_SUCCESS;
73 73
@@ -109,7 +109,7 @@ int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std: @@ -109,7 +109,7 @@ int SrsSecurity::allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std:
109 return ret; 109 return ret;
110 } 110 }
111 111
112 -int SrsSecurity::deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req) 112 +int SrsSecurity::deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip)
113 { 113 {
114 int ret = ERROR_SUCCESS; 114 int ret = ERROR_SUCCESS;
115 115
@@ -58,12 +58,12 @@ private: @@ -58,12 +58,12 @@ private:
58 * security check the allow, 58 * security check the allow,
59 * @return, if allowed, ERROR_SYSTEM_SECURITY_ALLOW. 59 * @return, if allowed, ERROR_SYSTEM_SECURITY_ALLOW.
60 */ 60 */
61 - virtual int allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req); 61 + virtual int allow_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip);
62 /** 62 /**
63 * security check the deny, 63 * security check the deny,
64 * @return, if denied, ERROR_SYSTEM_SECURITY_DENY. 64 * @return, if denied, ERROR_SYSTEM_SECURITY_DENY.
65 */ 65 */
66 - virtual int deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip, SrsRequest* req); 66 + virtual int deny_check(SrsConfDirective* rules, SrsRtmpConnType type, std::string ip);
67 }; 67 };
68 68
69 #endif 69 #endif