mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
use a sync.Pool for ackhandler.Frames (#3656)
This commit is contained in:
parent
b77d8570df
commit
2aa71ff76b
13 changed files with 129 additions and 90 deletions
|
@ -309,7 +309,7 @@ var _ = Describe("Connection", func() {
|
|||
err := conn.handleFrame(&wire.PathChallengeFrame{Data: data}, protocol.Encryption1RTT, protocol.ConnectionID{})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, 1000)
|
||||
Expect(frames).To(Equal([]ackhandler.Frame{{Frame: &wire.PathResponseFrame{Data: data}}}))
|
||||
Expect(frames).To(Equal([]*ackhandler.Frame{{Frame: &wire.PathResponseFrame{Data: data}}}))
|
||||
})
|
||||
|
||||
It("rejects NEW_TOKEN frames", func() {
|
||||
|
@ -1270,7 +1270,7 @@ var _ = Describe("Connection", func() {
|
|||
conn.scheduleSending()
|
||||
Eventually(sent).Should(BeClosed())
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, 1000)
|
||||
Expect(frames).To(Equal([]ackhandler.Frame{{Frame: &logging.DataBlockedFrame{MaximumData: 1337}}}))
|
||||
Expect(frames).To(Equal([]*ackhandler.Frame{{Frame: &logging.DataBlockedFrame{MaximumData: 1337}}}))
|
||||
})
|
||||
|
||||
It("doesn't send when the SentPacketHandler doesn't allow it", func() {
|
||||
|
@ -1867,8 +1867,8 @@ var _ = Describe("Connection", func() {
|
|||
handshakeCtx := conn.HandshakeComplete()
|
||||
Consistently(handshakeCtx.Done()).ShouldNot(BeClosed())
|
||||
close(finishHandshake)
|
||||
var frames []ackhandler.Frame
|
||||
Eventually(func() []ackhandler.Frame {
|
||||
var frames []*ackhandler.Frame
|
||||
Eventually(func() []*ackhandler.Frame {
|
||||
frames, _ = conn.framer.AppendControlFrames(nil, protocol.MaxByteCount)
|
||||
return frames
|
||||
}).ShouldNot(BeEmpty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue