mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 05:07:36 +03:00
refactor the framer to remove the version param from the constructor
This commit is contained in:
parent
4bb9f29b55
commit
00624f623d
7 changed files with 79 additions and 84 deletions
|
@ -308,7 +308,7 @@ var _ = Describe("Connection", func() {
|
|||
data := [8]byte{1, 2, 3, 4, 5, 6, 7, 8}
|
||||
err := conn.handleFrame(&wire.PathChallengeFrame{Data: data}, protocol.Encryption1RTT, protocol.ConnectionID{})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, 1000)
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, 1000, protocol.Version1)
|
||||
Expect(frames).To(Equal([]*ackhandler.Frame{{Frame: &wire.PathResponseFrame{Data: data}}}))
|
||||
})
|
||||
|
||||
|
@ -1269,7 +1269,7 @@ var _ = Describe("Connection", func() {
|
|||
tracer.EXPECT().SentShortHeaderPacket(gomock.Any(), buffer.Len(), nil, []logging.Frame{})
|
||||
conn.scheduleSending()
|
||||
Eventually(sent).Should(BeClosed())
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, 1000)
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, 1000, protocol.Version1)
|
||||
Expect(frames).To(Equal([]*ackhandler.Frame{{Frame: &logging.DataBlockedFrame{MaximumData: 1337}}}))
|
||||
})
|
||||
|
||||
|
@ -1869,7 +1869,7 @@ var _ = Describe("Connection", func() {
|
|||
close(finishHandshake)
|
||||
var frames []*ackhandler.Frame
|
||||
Eventually(func() []*ackhandler.Frame {
|
||||
frames, _ = conn.framer.AppendControlFrames(nil, protocol.MaxByteCount)
|
||||
frames, _ = conn.framer.AppendControlFrames(nil, protocol.MaxByteCount, protocol.Version1)
|
||||
return frames
|
||||
}).ShouldNot(BeEmpty())
|
||||
var count int
|
||||
|
@ -1928,8 +1928,8 @@ var _ = Describe("Connection", func() {
|
|||
conn.sentPacketHandler = sph
|
||||
done := make(chan struct{})
|
||||
connRunner.EXPECT().Retire(clientDestConnID)
|
||||
packer.EXPECT().PackPacket(false, gomock.Any(), conn.version).DoAndReturn(func(bool, time.Time, protocol.VersionNumber) (shortHeaderPacket, *packetBuffer, error) {
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, protocol.MaxByteCount)
|
||||
packer.EXPECT().PackPacket(false, gomock.Any(), conn.version).DoAndReturn(func(_ bool, _ time.Time, v protocol.VersionNumber) (shortHeaderPacket, *packetBuffer, error) {
|
||||
frames, _ := conn.framer.AppendControlFrames(nil, protocol.MaxByteCount, v)
|
||||
Expect(frames).ToNot(BeEmpty())
|
||||
Expect(frames[0].Frame).To(BeEquivalentTo(&wire.HandshakeDoneFrame{}))
|
||||
defer close(done)
|
||||
|
@ -2744,7 +2744,7 @@ var _ = Describe("Client Connection", func() {
|
|||
conn.handleTransportParameters(params)
|
||||
conn.handleHandshakeComplete()
|
||||
// make sure the connection ID is not retired
|
||||
cf, _ := conn.framer.AppendControlFrames(nil, protocol.MaxByteCount)
|
||||
cf, _ := conn.framer.AppendControlFrames(nil, protocol.MaxByteCount, protocol.Version1)
|
||||
Expect(cf).To(BeEmpty())
|
||||
connRunner.EXPECT().AddResetToken(protocol.StatelessResetToken{16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}, conn)
|
||||
Expect(conn.connIDManager.Get()).To(Equal(protocol.ParseConnectionID([]byte{1, 2, 3, 4})))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue