mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Deprecate legacy VMess header with a planned decommission (#712)
* Deprecate legacy VMess header with a planned decommission * show legacy warning only once Co-authored-by: Xiaokang Wang <xiaokangwang@outlook.com> Co-authored-by: hmol233 <82594500+hmol233@users.noreply.github.com>
This commit is contained in:
parent
dbcbb519e3
commit
f2cb13a8ec
3 changed files with 31 additions and 2 deletions
|
@ -40,6 +40,8 @@ type TimedUserValidator struct {
|
|||
behaviorFused bool
|
||||
|
||||
aeadDecoderHolder *aead.AuthIDDecoderHolder
|
||||
|
||||
legacyWarnShown bool
|
||||
}
|
||||
|
||||
type indexTimePair struct {
|
||||
|
@ -245,6 +247,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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue