1
This commit is contained in:
parent
1978be72df
commit
5e680b6e39
@ -98,8 +98,8 @@ func (this *MetaMgr) secondInit() {
|
|||||||
defer this.ipBlackListMutex.Unlock()
|
defer this.ipBlackListMutex.Unlock()
|
||||||
defer this.fixedBlockRegionHashMutex.Unlock()
|
defer this.fixedBlockRegionHashMutex.Unlock()
|
||||||
|
|
||||||
this.accessKeyId = G.MetaMgr.GetAliKey().GetAccessKeyid()
|
this.accessKeyId = this.GetAliKey().GetAccessKeyid()
|
||||||
this.accessSecret = G.MetaMgr.GetAliKey().GetAccessSecret()
|
this.accessSecret = this.GetAliKey().GetAccessSecret()
|
||||||
|
|
||||||
this.ipWhiteList = make(map[string]int32)
|
this.ipWhiteList = make(map[string]int32)
|
||||||
this.ipBlackList = 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 {
|
func (this* MetaMgr) IsBlockZone(country string, province string, city string) bool {
|
||||||
|
this.fixedBlockRegionHashMutex.Lock()
|
||||||
|
defer this.fixedBlockRegionHashMutex.Unlock()
|
||||||
|
|
||||||
if country == "" || province == "" || city == "" {
|
if country == "" || province == "" || city == "" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if country != "中国" {
|
if country != "中国" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if _, ok := this.fixedBlockRegionHash[province]; ok {
|
||||||
/*this.blockRegionHashMutex.Lock()
|
|
||||||
defer this.blockRegionHashMutex.Unlock()
|
|
||||||
if _, ok := this.blockRegionHash[province]; ok {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if _, ok := this.blockRegionHash[city]; ok {
|
if _, ok := this.fixedBlockRegionHash[city]; ok {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if _, ok := this.blockRegionHash[province + "/" + city]; ok {
|
if _, ok := this.fixedBlockRegionHash[province + "/" + city]; ok {
|
||||||
return true
|
return true
|
||||||
}*/
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -194,6 +194,7 @@ func (this *RiskMgr) _analyseIsOpen(c *f5.Context) {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
beginTick := q5.GetTickCount()
|
||||||
if isPass() {
|
if isPass() {
|
||||||
atomic.AddInt64(&this.totalPassTimes, 1)
|
atomic.AddInt64(&this.totalPassTimes, 1)
|
||||||
atomic.AddInt64(&this.passTimes, 1)
|
atomic.AddInt64(&this.passTimes, 1)
|
||||||
@ -208,6 +209,7 @@ func (this *RiskMgr) _analyseIsOpen(c *f5.Context) {
|
|||||||
} else {
|
} else {
|
||||||
c.ResponseInt32Ok("is_open", 1)
|
c.ResponseInt32Ok("is_open", 1)
|
||||||
}
|
}
|
||||||
|
f5.SysLog().Info("time:%d analyse pass:%s", q5.GetTickCount() - beginTick, responseStr)
|
||||||
} else {
|
} else {
|
||||||
atomic.AddInt64(&this.totalBlockTimes, 1)
|
atomic.AddInt64(&this.totalBlockTimes, 1)
|
||||||
atomic.AddInt64(&this.blockTimes, 1)
|
atomic.AddInt64(&this.blockTimes, 1)
|
||||||
@ -222,6 +224,7 @@ func (this *RiskMgr) _analyseIsOpen(c *f5.Context) {
|
|||||||
} else {
|
} else {
|
||||||
c.ResponseInt32Ok("is_open", 0)
|
c.ResponseInt32Ok("is_open", 0)
|
||||||
}
|
}
|
||||||
|
f5.SysLog().Warning("time:%d analyse block:%s", q5.GetTickCount() - beginTick, responseStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
third_party/f5
vendored
2
third_party/f5
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 17a44afd7cb2249356f911203ec83ca1c4d50e8b
|
Subproject commit 32919e76e14935e089dfae84aa346f6b9031c3ea
|
Loading…
x
Reference in New Issue
Block a user