refactor header parsing in a version independent and dependent part

This commit is contained in:
Marten Seemann
2018-06-30 23:32:26 +07:00
parent 74ed3f7037
commit 4109c85c8a
20 changed files with 1587 additions and 1804 deletions

View File

@@ -1823,7 +1823,7 @@ var _ = Describe("Client Session", func() {
sess.queueControlFrame(&wire.PingFrame{})
var packet []byte
Eventually(mconn.written).Should(Receive(&packet))
hdr, err := wire.ParseHeaderSentByClient(bytes.NewReader(packet))
hdr, err := wire.ParseInvariantHeader(bytes.NewReader(packet))
Expect(err).ToNot(HaveOccurred())
Expect(hdr.DestConnectionID).To(Equal(protocol.ConnectionID{1, 3, 3, 7, 1, 3, 3, 7}))
// make sure the go routine returns