mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-06-15 23:39:56 -04:00
show legacy warning only once
This commit is contained in:
@@ -42,6 +42,8 @@ type TimedUserValidator struct {
|
||||
behaviorFused bool
|
||||
|
||||
aeadDecoderHolder *aead.AuthIDDecoderHolder
|
||||
|
||||
legacyWarnShown bool
|
||||
}
|
||||
|
||||
type indexTimePair struct {
|
||||
@@ -247,6 +249,17 @@ func (v *TimedUserValidator) BurnTaintFuse(userHash []byte) error {
|
||||
return ErrNotFound
|
||||
}
|
||||
|
||||
/* ShouldShowLegacyWarn will return whether a Legacy Warning should be shown
|
||||
Not guaranteed to only return true once for every inbound, but it is okay.
|
||||
*/
|
||||
func (v *TimedUserValidator) ShouldShowLegacyWarn() bool {
|
||||
if v.legacyWarnShown {
|
||||
return false
|
||||
}
|
||||
v.legacyWarnShown = true
|
||||
return true
|
||||
}
|
||||
|
||||
var ErrNotFound = newError("Not Found")
|
||||
|
||||
var ErrTainted = newError("ErrTainted")
|
||||
|
||||
Reference in New Issue
Block a user