Add retire_prior_to to NewConnectionId frame IETF altered the NewConnectionId frame format, adding a "retire_prior_to" field. This CL adds that field and modifies the framer and tests as needed. gfe-relnote: N/A is only for IETF QUIC (version 99 flag protected) NEW_REQUIRED_FIELD_OK="Message not currently in use, nothing in the logs" Note wrt the protobuf update - this CL adds a field to an IETF QUIC frame. Correspondingly, the relevant protobuf gets a new field. Since IETF QUIC is not in use, there are no instances of this protobuf in use/existance/etc yet ... so there is no incompatbility with other processes/etc to be concerned with. PiperOrigin-RevId: 257833679 Change-Id: I80d80db9f1f23b8e570c504199fdd346b7cb4ca4
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc index cdb941f..6c089c1 100644 --- a/quic/core/quic_framer.cc +++ b/quic/core/quic_framer.cc
@@ -768,6 +768,7 @@ const QuicNewConnectionIdFrame& frame) { return kQuicFrameTypeSize + QuicDataWriter::GetVarInt62Len(frame.sequence_number) + + QuicDataWriter::GetVarInt62Len(frame.retire_prior_to) + kConnectionIdLengthSize + frame.connection_id.length() + sizeof(frame.stateless_reset_token); } @@ -5998,6 +5999,10 @@ set_detailed_error("Can not write New Connection ID sequence number"); return false; } + if (!writer->WriteVarInt62(frame.retire_prior_to)) { + set_detailed_error("Can not write New Connection ID retire_prior_to"); + return false; + } if (!writer->WriteUInt8(frame.connection_id.length())) { set_detailed_error( "Can not write New Connection ID frame connection ID Length"); @@ -6025,6 +6030,15 @@ return false; } + if (!reader->ReadVarInt62(&frame->retire_prior_to)) { + set_detailed_error( + "Unable to read new connection ID frame retire_prior_to."); + return false; + } + if (frame->retire_prior_to > frame->sequence_number) { + set_detailed_error("Retire_prior_to > sequence_number."); + return false; + } uint8_t connection_id_length; if (!reader->ReadUInt8(&connection_id_length)) { set_detailed_error(