diff --git a/server/analyseapi/metamgr.go b/server/analyseapi/metamgr.go index 7718d08..28b9adb 100644 --- a/server/analyseapi/metamgr.go +++ b/server/analyseapi/metamgr.go @@ -98,8 +98,8 @@ func (this *MetaMgr) secondInit() { defer this.ipBlackListMutex.Unlock() defer this.fixedBlockRegionHashMutex.Unlock() - this.accessKeyId = G.MetaMgr.GetAliKey().GetAccessKeyid() - this.accessSecret = G.MetaMgr.GetAliKey().GetAccessSecret() + this.accessKeyId = this.GetAliKey().GetAccessKeyid() + this.accessSecret = this.GetAliKey().GetAccessSecret() this.ipWhiteList = make(map[string]int32) this.ipBlackList = make(map[string]int32) @@ -207,23 +207,23 @@ func (this* MetaMgr) GetSdkInfo(accessKeyId* string, accessSecret* string) { } func (this* MetaMgr) IsBlockZone(country string, province string, city string) bool { + this.fixedBlockRegionHashMutex.Lock() + defer this.fixedBlockRegionHashMutex.Unlock() + if country == "" || province == "" || city == "" { return true } if country != "中国" { return true } - - /*this.blockRegionHashMutex.Lock() - defer this.blockRegionHashMutex.Unlock() - if _, ok := this.blockRegionHash[province]; ok { + if _, ok := this.fixedBlockRegionHash[province]; ok { return true } - if _, ok := this.blockRegionHash[city]; ok { + if _, ok := this.fixedBlockRegionHash[city]; ok { return true } - if _, ok := this.blockRegionHash[province + "/" + city]; ok { + if _, ok := this.fixedBlockRegionHash[province + "/" + city]; ok { return true - }*/ + } return false } diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go index c4873b1..bcafce2 100644 --- a/server/analyseapi/riskmgr.go +++ b/server/analyseapi/riskmgr.go @@ -194,6 +194,7 @@ func (this *RiskMgr) _analyseIsOpen(c *f5.Context) { return false } } + beginTick := q5.GetTickCount() if isPass() { atomic.AddInt64(&this.totalPassTimes, 1) atomic.AddInt64(&this.passTimes, 1) @@ -208,6 +209,7 @@ func (this *RiskMgr) _analyseIsOpen(c *f5.Context) { } else { c.ResponseInt32Ok("is_open", 1) } + f5.SysLog().Info("time:%d analyse pass:%s", q5.GetTickCount() - beginTick, responseStr) } else { atomic.AddInt64(&this.totalBlockTimes, 1) atomic.AddInt64(&this.blockTimes, 1) @@ -222,6 +224,7 @@ func (this *RiskMgr) _analyseIsOpen(c *f5.Context) { } else { c.ResponseInt32Ok("is_open", 0) } + f5.SysLog().Warning("time:%d analyse block:%s", q5.GetTickCount() - beginTick, responseStr) } } diff --git a/third_party/f5 b/third_party/f5 index 17a44af..32919e7 160000 --- a/third_party/f5 +++ b/third_party/f5 @@ -1 +1 @@ -Subproject commit 17a44afd7cb2249356f911203ec83ca1c4d50e8b +Subproject commit 32919e76e14935e089dfae84aa346f6b9031c3ea