embed the Header in the ExtendedHeader

This commit is contained in:
Marten Seemann 2018-11-25 16:47:29 +07:00
parent af157408de
commit b740d57c61
12 changed files with 306 additions and 244 deletions

View file

@ -50,9 +50,9 @@ var _ = Describe("Client", func() {
acceptClientVersionPacket := func(connID protocol.ConnectionID) []byte {
b := &bytes.Buffer{}
Expect((&wire.ExtendedHeader{
DestConnectionID: connID,
PacketNumber: 1,
PacketNumberLen: 1,
Header: wire.Header{DestConnectionID: connID},
PacketNumber: 1,
PacketNumberLen: 1,
}).Write(b, protocol.VersionWhatever)).To(Succeed())
return b.Bytes()
}
@ -516,7 +516,7 @@ var _ = Describe("Client", func() {
DestConnectionID: id,
},
extHdr: &wire.ExtendedHeader{
IsLongHeader: true,
Header: wire.Header{IsLongHeader: true},
Type: protocol.PacketTypeRetry,
Token: []byte("foobar"),
OrigDestConnectionID: connID,
@ -580,11 +580,13 @@ var _ = Describe("Client", func() {
Version: cl.version,
},
extHdr: &wire.ExtendedHeader{
IsLongHeader: true,
Header: wire.Header{
IsLongHeader: true,
Version: protocol.VersionTLS,
},
Type: protocol.PacketTypeRetry,
Token: []byte("foobar"),
OrigDestConnectionID: connID,
Version: protocol.VersionTLS,
},
})
}).AnyTimes()