diff --git a/conn_id_generator.go b/conn_id_generator.go index 7bcc3581..ff961508 100644 --- a/conn_id_generator.go +++ b/conn_id_generator.go @@ -77,7 +77,7 @@ func (m *connIDGenerator) Retire(seq uint64, sentWithDestConnID protocol.Connect return nil } if connID.Equal(sentWithDestConnID) { - return qerr.NewError(qerr.FrameEncodingError, fmt.Sprintf("tried to retire connection ID %d (%s), which was used as the Destination Connection ID on this packet", seq, connID)) + return qerr.NewError(qerr.ProtocolViolation, fmt.Sprintf("tried to retire connection ID %d (%s), which was used as the Destination Connection ID on this packet", seq, connID)) } m.retireConnectionID(connID) delete(m.activeSrcConnIDs, seq) diff --git a/conn_id_generator_test.go b/conn_id_generator_test.go index 7b51b480..fc36c766 100644 --- a/conn_id_generator_test.go +++ b/conn_id_generator_test.go @@ -78,7 +78,7 @@ var _ = Describe("Connection ID Generator", func() { Expect(queuedFrames).ToNot(BeEmpty()) Expect(queuedFrames[0]).To(BeAssignableToTypeOf(&wire.NewConnectionIDFrame{})) f := queuedFrames[0].(*wire.NewConnectionIDFrame) - Expect(g.Retire(f.SequenceNumber, f.ConnectionID)).To(MatchError(fmt.Sprintf("FRAME_ENCODING_ERROR: tried to retire connection ID %d (%s), which was used as the Destination Connection ID on this packet", f.SequenceNumber, f.ConnectionID))) + Expect(g.Retire(f.SequenceNumber, f.ConnectionID)).To(MatchError(fmt.Sprintf("PROTOCOL_VIOLATION: tried to retire connection ID %d (%s), which was used as the Destination Connection ID on this packet", f.SequenceNumber, f.ConnectionID))) }) It("issues new connection IDs, when old ones are retired", func() {