From ccb2e9a2dfaf1d0995f87764cccd46ae2f8d771c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 1 Nov 2017 15:49:34 +0700 Subject: [PATCH] remove check for CONGESTION_FEEDBACK in the packet unpacker CONGESTION_FEEDBACK was reserved for future use in gQUIC, but has never actually been implemented. It won't make it to IETF QUIC, so we don't need to check for it. Note that we'd still reject a CONGESTION_FEEDBACK frame, since we're rejecting any unknown frame type. --- packet_unpacker.go | 3 --- packet_unpacker_test.go | 6 ------ 2 files changed, 9 deletions(-) diff --git a/packet_unpacker.go b/packet_unpacker.go index 02610111..d31e535f 100644 --- a/packet_unpacker.go +++ b/packet_unpacker.go @@ -2,7 +2,6 @@ package quic import ( "bytes" - "errors" "fmt" "github.com/lucas-clemente/quic-go/internal/protocol" @@ -64,8 +63,6 @@ func (u *packetUnpacker) Unpack(headerBinary []byte, hdr *wire.Header, data []by if err != nil { err = qerr.Error(qerr.InvalidAckData, err.Error()) } - } else if typeByte&0xe0 == 0x20 { - err = errors.New("unimplemented: CONGESTION_FEEDBACK") } else { switch typeByte { case 0x01: diff --git a/packet_unpacker_test.go b/packet_unpacker_test.go index 3d4c2219..be8d608d 100644 --- a/packet_unpacker_test.go +++ b/packet_unpacker_test.go @@ -92,12 +92,6 @@ var _ = Describe("Packet unpacker", func() { Expect(readFrame.LargestAcked).To(Equal(protocol.PacketNumber(0x13))) }) - It("errors on CONGESTION_FEEDBACK frames", func() { - setData([]byte{0x20}) - _, err := unpacker.Unpack(hdrBin, hdr, data) - Expect(err).To(MatchError("unimplemented: CONGESTION_FEEDBACK")) - }) - It("handles PADDING frames", func() { setData([]byte{0, 0, 0}) // 3 bytes PADDING packet, err := unpacker.Unpack(hdrBin, hdr, data)