mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
don't delete a stream until it has been accepted
This commit is contained in:
parent
d6521fa3cc
commit
f17ddffb70
5 changed files with 167 additions and 9 deletions
|
@ -158,6 +158,17 @@ var _ = Describe("Streams Map", func() {
|
|||
Expect(dstr).To(BeNil())
|
||||
})
|
||||
|
||||
It("accepts bidirectional streams after they have been deleted", func() {
|
||||
id := ids.firstIncomingBidiStream
|
||||
_, err := m.GetOrOpenReceiveStream(id)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(m.DeleteStream(id)).To(Succeed())
|
||||
str, err := m.AcceptStream()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(str).ToNot(BeNil())
|
||||
Expect(str.StreamID()).To(Equal(id))
|
||||
})
|
||||
|
||||
It("deletes outgoing unidirectional streams", func() {
|
||||
id := ids.firstOutgoingUniStream
|
||||
str, err := m.OpenUniStream()
|
||||
|
@ -179,6 +190,17 @@ var _ = Describe("Streams Map", func() {
|
|||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(dstr).To(BeNil())
|
||||
})
|
||||
|
||||
It("accepts unirectional streams after they have been deleted", func() {
|
||||
id := ids.firstIncomingUniStream
|
||||
_, err := m.GetOrOpenReceiveStream(id)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(m.DeleteStream(id)).To(Succeed())
|
||||
str, err := m.AcceptUniStream()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(str).ToNot(BeNil())
|
||||
Expect(str.StreamID()).To(Equal(id))
|
||||
})
|
||||
})
|
||||
|
||||
Context("getting streams", func() {
|
||||
|
@ -340,6 +362,8 @@ var _ = Describe("Streams Map", func() {
|
|||
It("sends a MAX_STREAMS frame for bidirectional streams", func() {
|
||||
_, err := m.GetOrOpenReceiveStream(ids.firstIncomingBidiStream)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
_, err = m.AcceptStream()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
mockSender.EXPECT().queueControlFrame(&wire.MaxStreamsFrame{
|
||||
Type: protocol.StreamTypeBidi,
|
||||
MaxStreams: maxBidiStreams + 1,
|
||||
|
@ -350,6 +374,8 @@ var _ = Describe("Streams Map", func() {
|
|||
It("sends a MAX_STREAMS frame for unidirectional streams", func() {
|
||||
_, err := m.GetOrOpenReceiveStream(ids.firstIncomingUniStream)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
_, err = m.AcceptUniStream()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
mockSender.EXPECT().queueControlFrame(&wire.MaxStreamsFrame{
|
||||
Type: protocol.StreamTypeUni,
|
||||
MaxStreams: maxUniStreams + 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue