implement handling of coalesced packets

This commit is contained in:
Marten Seemann 2018-12-29 17:48:28 +07:00
parent 6ce7a204fc
commit d3ea7c0c4c
4 changed files with 205 additions and 72 deletions

View file

@ -29,4 +29,15 @@ var _ = Describe("Buffer Pool", func() {
putPacketBuffer(buf)
Expect(func() { putPacketBuffer(buf) }).To(Panic())
})
It("waits until all parts have been put back", func() {
buf := getPacketBuffer()
buf.Split()
buf.Split()
// now we have 3 parts
putPacketBuffer(buf)
putPacketBuffer(buf)
putPacketBuffer(buf)
Expect(func() { putPacketBuffer(buf) }).To(Panic())
})
})