mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
reject transport parameters with too large stream counts
This commit is contained in:
parent
7b02b87026
commit
51c9c42adc
4 changed files with 32 additions and 13 deletions
|
@ -295,33 +295,43 @@ var _ = Describe("Streams Map", func() {
|
|||
})
|
||||
|
||||
Context("updating stream ID limits", func() {
|
||||
BeforeEach(func() {
|
||||
mockSender.EXPECT().queueControlFrame(gomock.Any())
|
||||
})
|
||||
|
||||
It("processes the parameter for outgoing streams, as a server", func() {
|
||||
mockSender.EXPECT().queueControlFrame(gomock.Any())
|
||||
m.perspective = protocol.PerspectiveServer
|
||||
_, err := m.OpenStream()
|
||||
expectTooManyStreamsError(err)
|
||||
m.UpdateLimits(&handshake.TransportParameters{
|
||||
Expect(m.UpdateLimits(&handshake.TransportParameters{
|
||||
MaxBidiStreams: 5,
|
||||
MaxUniStreams: 5,
|
||||
})
|
||||
})).To(Succeed())
|
||||
Expect(m.outgoingBidiStreams.maxStream).To(Equal(protocol.StreamID(17)))
|
||||
Expect(m.outgoingUniStreams.maxStream).To(Equal(protocol.StreamID(19)))
|
||||
})
|
||||
|
||||
It("processes the parameter for outgoing streams, as a client", func() {
|
||||
mockSender.EXPECT().queueControlFrame(gomock.Any())
|
||||
m.perspective = protocol.PerspectiveClient
|
||||
_, err := m.OpenUniStream()
|
||||
expectTooManyStreamsError(err)
|
||||
m.UpdateLimits(&handshake.TransportParameters{
|
||||
Expect(m.UpdateLimits(&handshake.TransportParameters{
|
||||
MaxBidiStreams: 5,
|
||||
MaxUniStreams: 5,
|
||||
})
|
||||
})).To(Succeed())
|
||||
Expect(m.outgoingBidiStreams.maxStream).To(Equal(protocol.StreamID(16)))
|
||||
Expect(m.outgoingUniStreams.maxStream).To(Equal(protocol.StreamID(18)))
|
||||
})
|
||||
|
||||
It("rejects parameters with too large unidirectional stream counts", func() {
|
||||
Expect(m.UpdateLimits(&handshake.TransportParameters{
|
||||
MaxUniStreams: protocol.MaxStreamCount + 1,
|
||||
})).To(MatchError(qerr.StreamLimitError))
|
||||
})
|
||||
|
||||
It("rejects parameters with too large unidirectional stream counts", func() {
|
||||
Expect(m.UpdateLimits(&handshake.TransportParameters{
|
||||
MaxBidiStreams: protocol.MaxStreamCount + 1,
|
||||
})).To(MatchError(qerr.StreamLimitError))
|
||||
})
|
||||
})
|
||||
|
||||
Context("handling MAX_STREAMS frames", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue