From f89941254ac9efb0417d014d1178a6759b5933f3 Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 2 Jan 2015 16:06:18 +0800 Subject: [PATCH] refine code of security deny check --- trunk/src/app/srs_app_security.cpp | 8 ++++---- trunk/src/app/srs_app_security.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/trunk/src/app/srs_app_security.cpp b/trunk/src/app/srs_app_security.cpp index 14a128ef5..8d42105d4 100644 --- a/trunk/src/app/srs_app_security.cpp +++ b/trunk/src/app/srs_app_security.cpp @@ -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; diff --git a/trunk/src/app/srs_app_security.hpp b/trunk/src/app/srs_app_security.hpp index d2c30ff24..9f1e9dec4 100644 --- a/trunk/src/app/srs_app_security.hpp +++ b/trunk/src/app/srs_app_security.hpp @@ -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