1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00
This commit is contained in:
Darien Raymond 2018-10-19 16:23:29 +02:00
parent fb7dd1a577
commit d9cdfffc69
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -20,6 +20,7 @@ type user struct {
lastSec protocol.Timestamp
}
// TimedUserValidator is a user Validator based on time.
type TimedUserValidator struct {
sync.RWMutex
users []*user
@ -34,6 +35,7 @@ type indexTimePair struct {
timeInc uint32
}
// NewTimedUserValidator creates a new TimedUserValidator.
func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator {
tuv := &TimedUserValidator{
users: make([]*user, 0, 16),