Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused initialVersion variable in session #2946

Merged
merged 1 commit into from Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion client.go
Expand Up @@ -281,7 +281,6 @@ func (c *client) dial(ctx context.Context) error {
c.config,
c.tlsConf,
c.initialPacketNumber,
c.version,
c.use0RTT,
c.hasNegotiatedVersion,
c.tracer,
Expand Down
14 changes: 0 additions & 14 deletions client_test.go
Expand Up @@ -39,7 +39,6 @@ var _ = Describe("Client", func() {
conf *Config,
tlsConf *tls.Config,
initialPacketNumber protocol.PacketNumber,
initialVersion protocol.VersionNumber,
enable0RTT bool,
hasNegotiatedVersion bool,
tracer logging.ConnectionTracer,
Expand Down Expand Up @@ -127,7 +126,6 @@ var _ = Describe("Client", func() {
_ *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -160,7 +158,6 @@ var _ = Describe("Client", func() {
_ *Config,
tlsConf *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -193,7 +190,6 @@ var _ = Describe("Client", func() {
_ *Config,
tlsConf *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -232,7 +228,6 @@ var _ = Describe("Client", func() {
_ *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
enable0RTT bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -275,7 +270,6 @@ var _ = Describe("Client", func() {
_ *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
enable0RTT bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -323,7 +317,6 @@ var _ = Describe("Client", func() {
_ *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -366,7 +359,6 @@ var _ = Describe("Client", func() {
_ *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -418,7 +410,6 @@ var _ = Describe("Client", func() {
_ *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -538,7 +529,6 @@ var _ = Describe("Client", func() {
configP *Config,
_ *tls.Config,
_ protocol.PacketNumber,
_ protocol.VersionNumber, /* initial version */
_ bool,
_ bool,
_ logging.ConnectionTracer,
Expand Down Expand Up @@ -580,7 +570,6 @@ var _ = Describe("Client", func() {
configP *Config,
_ *tls.Config,
pn protocol.PacketNumber,
version protocol.VersionNumber,
_ bool,
hasNegotiatedVersion bool,
_ logging.ConnectionTracer,
Expand All @@ -591,16 +580,13 @@ var _ = Describe("Client", func() {
sess.EXPECT().HandshakeComplete().Return(context.Background())
if counter == 0 {
Expect(pn).To(BeZero())
Expect(version).To(Equal(initialVersion))
Expect(hasNegotiatedVersion).To(BeFalse())
sess.EXPECT().run().Return(&errCloseForRecreating{
nextPacketNumber: 109,
nextVersion: 789,
})
} else {
Expect(pn).To(Equal(protocol.PacketNumber(109)))
Expect(version).ToNot(Equal(initialVersion))
Expect(version).To(Equal(protocol.VersionNumber(789)))
Expect(hasNegotiatedVersion).To(BeTrue())
sess.EXPECT().run()
}
Expand Down
9 changes: 3 additions & 6 deletions session.go
Expand Up @@ -132,10 +132,9 @@ type session struct {

srcConnIDLen int

perspective protocol.Perspective
initialVersion protocol.VersionNumber // if version negotiation is performed, this is the version we initially tried
version protocol.VersionNumber
config *Config
perspective protocol.Perspective
version protocol.VersionNumber
config *Config

conn sendConn
sendQueue *sendQueue
Expand Down Expand Up @@ -356,7 +355,6 @@ var newClientSession = func(
conf *Config,
tlsConf *tls.Config,
initialPacketNumber protocol.PacketNumber,
initialVersion protocol.VersionNumber,
enable0RTT bool,
hasNegotiatedVersion bool,
tracer logging.ConnectionTracer,
Expand All @@ -374,7 +372,6 @@ var newClientSession = func(
logID: destConnID.String(),
logger: logger,
tracer: tracer,
initialVersion: initialVersion,
versionNegotiated: hasNegotiatedVersion,
version: v,
}
Expand Down
1 change: 0 additions & 1 deletion session_test.go
Expand Up @@ -2225,7 +2225,6 @@ var _ = Describe("Client Session", func() {
quicConf,
tlsConf,
42, // initial packet number
protocol.VersionTLS,
false,
false,
tracer,
Expand Down