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

only accept 0-RTT it the active_connection_id_limit didn't change #3060

Merged
merged 1 commit into from
Mar 9, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions internal/wire/transport_parameter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,56 +482,55 @@ var _ = Describe("Transport Parameters", func() {
})

Context("rejects the parameters if they changed", func() {
var p *TransportParameters
var p TransportParameters
params := &TransportParameters{
InitialMaxStreamDataBidiLocal: 1,
InitialMaxStreamDataBidiRemote: 2,
InitialMaxStreamDataUni: 3,
InitialMaxData: 4,
MaxBidiStreamNum: 5,
MaxUniStreamNum: 6,
ActiveConnectionIDLimit: 7,
}

BeforeEach(func() {
p = &TransportParameters{
InitialMaxStreamDataBidiLocal: 1,
InitialMaxStreamDataBidiRemote: 2,
InitialMaxStreamDataUni: 3,
InitialMaxData: 4,
MaxBidiStreamNum: 5,
MaxUniStreamNum: 6,
}
Expect(params.ValidFor0RTT(p)).To(BeTrue())
p = *params
Expect(params.ValidFor0RTT(&p)).To(BeTrue())
})

It("rejects the parameters if the InitialMaxStreamDataBidiLocal changed", func() {
p.InitialMaxStreamDataBidiLocal = 0
Expect(params.ValidFor0RTT(p)).To(BeFalse())
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})

It("rejects the parameters if the InitialMaxStreamDataBidiRemote changed", func() {
p.InitialMaxStreamDataBidiRemote = 0
Expect(params.ValidFor0RTT(p)).To(BeFalse())
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})

It("rejects the parameters if the InitialMaxStreamDataUni changed", func() {
p.InitialMaxStreamDataUni = 0
Expect(params.ValidFor0RTT(p)).To(BeFalse())
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})

It("rejects the parameters if the InitialMaxData changed", func() {
p.InitialMaxData = 0
Expect(params.ValidFor0RTT(p)).To(BeFalse())
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})

It("rejects the parameters if the MaxBidiStreamNum changed", func() {
p.MaxBidiStreamNum = 0
Expect(params.ValidFor0RTT(p)).To(BeFalse())
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})

It("rejects the parameters if the MaxUniStreamNum changed", func() {
p.MaxUniStreamNum = 0
Expect(params.ValidFor0RTT(p)).To(BeFalse())
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})

It("rejects the parameters if the ActiveConnectionIDLimit changed", func() {
p.ActiveConnectionIDLimit = 0
Expect(params.ValidFor0RTT(&p)).To(BeFalse())
})
})
})
Expand Down
3 changes: 2 additions & 1 deletion internal/wire/transport_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ func (p *TransportParameters) ValidFor0RTT(tp *TransportParameters) bool {
p.InitialMaxStreamDataUni == tp.InitialMaxStreamDataUni &&
p.InitialMaxData == tp.InitialMaxData &&
p.MaxBidiStreamNum == tp.MaxBidiStreamNum &&
p.MaxUniStreamNum == tp.MaxUniStreamNum
p.MaxUniStreamNum == tp.MaxUniStreamNum &&
p.ActiveConnectionIDLimit == tp.ActiveConnectionIDLimit
}

// String returns a string representation, intended for logging.
Expand Down