mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
handle the crypto stream separately in the packet packer
This commit is contained in:
parent
f68621485f
commit
25847cfc30
12 changed files with 123 additions and 137 deletions
|
@ -72,38 +72,6 @@ var _ = Describe("Stream Framer", func() {
|
|||
})
|
||||
})
|
||||
|
||||
Context("handling the crypto stream", func() {
|
||||
It("says if it has crypto stream data", func() {
|
||||
Expect(framer.HasCryptoStreamData()).To(BeFalse())
|
||||
framer.AddActiveStream(framer.version.CryptoStreamID())
|
||||
Expect(framer.HasCryptoStreamData()).To(BeTrue())
|
||||
})
|
||||
|
||||
It("says that it doesn't have crypto stream data after popping all data", func() {
|
||||
streamID := framer.version.CryptoStreamID()
|
||||
f := &wire.StreamFrame{
|
||||
StreamID: streamID,
|
||||
Data: []byte("foobar"),
|
||||
}
|
||||
cryptoStream.EXPECT().popStreamFrame(protocol.ByteCount(1000)).Return(f, false)
|
||||
framer.AddActiveStream(streamID)
|
||||
Expect(framer.PopCryptoStreamFrame(1000)).To(Equal(f))
|
||||
Expect(framer.HasCryptoStreamData()).To(BeFalse())
|
||||
})
|
||||
|
||||
It("says that it has more crypto stream data if not all data was popped", func() {
|
||||
streamID := framer.version.CryptoStreamID()
|
||||
f := &wire.StreamFrame{
|
||||
StreamID: streamID,
|
||||
Data: []byte("foobar"),
|
||||
}
|
||||
cryptoStream.EXPECT().popStreamFrame(protocol.ByteCount(1000)).Return(f, true)
|
||||
framer.AddActiveStream(streamID)
|
||||
Expect(framer.PopCryptoStreamFrame(1000)).To(Equal(f))
|
||||
Expect(framer.HasCryptoStreamData()).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
Context("popping STREAM frames", func() {
|
||||
It("returns nil when popping an empty framer", func() {
|
||||
Expect(framer.AppendStreamFrames(nil, 1000)).To(BeEmpty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue