mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
sync: quic-go 0.42.0
Signed-off-by: Gaukas Wang <i@gaukas.wang>
This commit is contained in:
parent
d40dde9b9b
commit
4973374ea5
252 changed files with 13121 additions and 5437 deletions
|
@ -3,7 +3,6 @@ package quic
|
|||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/refraction-networking/uquic/internal/utils"
|
||||
list "github.com/refraction-networking/uquic/internal/utils/linkedlist"
|
||||
)
|
||||
|
||||
|
@ -20,14 +19,14 @@ func newSingleOriginTokenStore(size int) *singleOriginTokenStore {
|
|||
func (s *singleOriginTokenStore) Add(token *ClientToken) {
|
||||
s.tokens[s.p] = token
|
||||
s.p = s.index(s.p + 1)
|
||||
s.len = utils.Min(s.len+1, len(s.tokens))
|
||||
s.len = min(s.len+1, len(s.tokens))
|
||||
}
|
||||
|
||||
func (s *singleOriginTokenStore) Pop() *ClientToken {
|
||||
s.p = s.index(s.p - 1)
|
||||
token := s.tokens[s.p]
|
||||
s.tokens[s.p] = nil
|
||||
s.len = utils.Max(s.len-1, 0)
|
||||
s.len = max(s.len-1, 0)
|
||||
return token
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue