use tokens from the TokenStore when dialing

This commit is contained in:
Marten Seemann
2019-08-08 14:27:49 +07:00
parent 9c97a5e95f
commit e2d58b2333
2 changed files with 7 additions and 0 deletions

View File

@@ -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()
}

View File

@@ -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() {