forked from quic-go/quic-go
use tokens from the TokenStore when dialing
This commit is contained in:
@@ -339,6 +339,11 @@ var newClientSession = func(
|
||||
} else {
|
||||
s.tokenStoreKey = conn.RemoteAddr().String()
|
||||
}
|
||||
if s.config.TokenStore != nil {
|
||||
if token := s.config.TokenStore.Pop(s.tokenStoreKey); token != nil {
|
||||
s.packer.SetToken(token.data)
|
||||
}
|
||||
}
|
||||
return s, s.postSetup()
|
||||
}
|
||||
|
||||
|
||||
@@ -1660,6 +1660,8 @@ var _ = Describe("Client Session", func() {
|
||||
mockTokenStore = NewMockTokenStore(mockCtrl)
|
||||
tlsConf = &tls.Config{ServerName: "server"}
|
||||
quicConf.TokenStore = mockTokenStore
|
||||
mockTokenStore.EXPECT().Pop(gomock.Any())
|
||||
quicConf.TokenStore = mockTokenStore
|
||||
})
|
||||
|
||||
It("handles NEW_TOKEN frames", func() {
|
||||
|
||||
Reference in New Issue
Block a user