use STREAM frames from the buffer for sending data

This commit is contained in:
Marten Seemann 2019-09-04 20:24:09 +07:00
parent 039d7ae888
commit 4cfbb2f134
5 changed files with 57 additions and 42 deletions

View file

@ -408,8 +408,8 @@ var _ = Describe("Send Stream", func() {
mockSender.EXPECT().onHasStreamData(streamID)
str.Close()
frame, hasMoreData := str.popStreamFrame(1000)
Expect(frame).ToNot(BeNil())
f := frame.Frame.(*wire.StreamFrame)
Expect(f).ToNot(BeNil())
Expect(f.Data).To(BeEmpty())
Expect(f.FinBit).To(BeTrue())
Expect(hasMoreData).To(BeFalse())
@ -423,8 +423,8 @@ var _ = Describe("Send Stream", func() {
str.dataForWriting = []byte("foobar")
Expect(str.Close()).To(Succeed())
frame, _ := str.popStreamFrame(3 + frameHeaderLen)
Expect(frame).ToNot(BeNil())
f := frame.Frame.(*wire.StreamFrame)
Expect(f).ToNot(BeNil())
Expect(f.Data).To(Equal([]byte("foo")))
Expect(f.FinBit).To(BeFalse())
frame, _ = str.popStreamFrame(100)
@ -444,8 +444,8 @@ var _ = Describe("Send Stream", func() {
mockSender.EXPECT().onHasStreamData(streamID)
str.Close()
frame, _ := str.popStreamFrame(1000)
Expect(frame).ToNot(BeNil())
f := frame.Frame.(*wire.StreamFrame)
Expect(f).ToNot(BeNil())
Expect(f.Data).To(BeEmpty())
Expect(f.FinBit).To(BeTrue())
frame, hasMoreData := str.popStreamFrame(1000)