addressed reviewer comments

This commit is contained in:
Tatiana Bradley 2019-08-02 15:28:51 +00:00
parent e859b12ad4
commit 361fd2d2b2
4 changed files with 36 additions and 86 deletions

View file

@ -1748,11 +1748,12 @@ var _ = Describe("Client Session", func() {
Expect(sess.handlePacketImpl(getPacket(hdr2, nil))).To(BeFalse())
})
// Illustrates that an injected Initial with an ACK frame for an unsent causes
// Illustrates that an injected Initial with an ACK frame for an unsent packet causes
// the connection to immediately break down
It("fails on Initial-level ACK for unsent packet", func() {
sessionRunner.EXPECT().Retire(gomock.Any())
initialPacket := testutils.ComposeInitialPacket(sess.destConnID, sess.srcConnID, sess.version, sess.destConnID, testutils.AckFrame)
ackFrame := testutils.ComposeAckFrame(0, 0)
initialPacket := testutils.ComposeInitialPacket(sess.destConnID, sess.srcConnID, sess.version, sess.destConnID, []wire.Frame{ackFrame})
Expect(sess.handlePacketImpl(wrapPacket(initialPacket))).To(BeFalse())
})
@ -1760,7 +1761,8 @@ var _ = Describe("Client Session", func() {
// the connection to immediately break down
It("fails on Initial-level CONNECTION_CLOSE frame", func() {
sessionRunner.EXPECT().Remove(gomock.Any())
initialPacket := testutils.ComposeInitialPacket(sess.destConnID, sess.srcConnID, sess.version, sess.destConnID, testutils.ConnectionCloseFrame)
connCloseFrame := testutils.ComposeConnCloseFrame()
initialPacket := testutils.ComposeInitialPacket(sess.destConnID, sess.srcConnID, sess.version, sess.destConnID, []wire.Frame{connCloseFrame})
Expect(sess.handlePacketImpl(wrapPacket(initialPacket))).To(BeTrue())
})
@ -1773,7 +1775,7 @@ var _ = Describe("Client Session", func() {
packer.EXPECT().ChangeDestConnectionID(newSrcConnID)
sess.handlePacketImpl(wrapPacket(testutils.ComposeRetryPacket(newSrcConnID, sess.destConnID, sess.destConnID, []byte("foobar"), sess.version)))
initialPacket := testutils.ComposeInitialPacket(sess.destConnID, sess.srcConnID, sess.version, sess.destConnID, testutils.NoFrame)
initialPacket := testutils.ComposeInitialPacket(sess.destConnID, sess.srcConnID, sess.version, sess.destConnID, nil)
Expect(sess.handlePacketImpl(wrapPacket(initialPacket))).To(BeFalse())
})