This commit is contained in:
aozhiwei 2021-01-07 16:42:33 +08:00
parent 1978be72df
commit 5e680b6e39
3 changed files with 13 additions and 10 deletions

View File

@ -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
}

View File

@ -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)
}
}

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit 17a44afd7cb2249356f911203ec83ca1c4d50e8b
Subproject commit 32919e76e14935e089dfae84aa346f6b9031c3ea