wait until the handshake is complete before updating the connection ID

This commit is contained in:
Marten Seemann
2020-11-02 16:20:26 +07:00
parent 272229abf0
commit 80534c0944
4 changed files with 31 additions and 1 deletions

View File

@@ -2251,6 +2251,7 @@ var _ = Describe("Client Session", func() {
unpacker := NewMockUnpacker(mockCtrl)
sess.unpacker = unpacker
sessionRunner.EXPECT().AddResetToken(gomock.Any(), gomock.Any())
sess.connIDManager.SetHandshakeComplete()
sess.handleNewConnectionIDFrame(&wire.NewConnectionIDFrame{
SequenceNumber: 1,
ConnectionID: protocol.ConnectionID{1, 2, 3, 4, 5},
@@ -2494,6 +2495,7 @@ var _ = Describe("Client Session", func() {
packer.EXPECT().PackCoalescedPacket(protocol.MaxByteCount).MaxTimes(1)
tracer.EXPECT().ReceivedTransportParameters(params)
sess.processTransportParameters(params)
sess.connIDManager.SetHandshakeComplete()
// make sure the connection ID is not retired
cf, _ := sess.framer.AppendControlFrames(nil, protocol.MaxByteCount)
Expect(cf).To(BeEmpty())