Move RFC 9000 variable length integer encoding from QUIC to QUICHE
Since BHTTP uses these, and we're starting BHTTP in QUICHE, we need to move the read/write functions for varints to QUICHE. While I was in there, I improved some comments to refer to the published RFC, and removed a few ODR violations.
This CL is a no-op, it does not modify any existing functionality.
PiperOrigin-RevId: 467990159
diff --git a/quiche/quic/core/quic_connection_test.cc b/quiche/quic/core/quic_connection_test.cc
index 21a4bbf..dca0520 100644
--- a/quiche/quic/core/quic_connection_test.cc
+++ b/quiche/quic/core/quic_connection_test.cc
@@ -1119,9 +1119,10 @@
header.long_packet_type = EncryptionlevelToLongHeaderType(level);
if (QuicVersionHasLongHeaderLengths(
peer_framer_.version().transport_version)) {
- header.length_length = VARIABLE_LENGTH_INTEGER_LENGTH_2;
+ header.length_length = quiche::VARIABLE_LENGTH_INTEGER_LENGTH_2;
if (header.long_packet_type == INITIAL) {
- header.retry_token_length_length = VARIABLE_LENGTH_INTEGER_LENGTH_1;
+ header.retry_token_length_length =
+ quiche::VARIABLE_LENGTH_INTEGER_LENGTH_1;
}
}
}
@@ -2893,8 +2894,8 @@
if (QuicVersionHasLongHeaderLengths(
peer_framer_.version().transport_version)) {
header.long_packet_type = INITIAL;
- header.retry_token_length_length = VARIABLE_LENGTH_INTEGER_LENGTH_1;
- header.length_length = VARIABLE_LENGTH_INTEGER_LENGTH_2;
+ header.retry_token_length_length = quiche::VARIABLE_LENGTH_INTEGER_LENGTH_1;
+ header.length_length = quiche::VARIABLE_LENGTH_INTEGER_LENGTH_2;
}
QuicFrames frames;
@@ -2941,8 +2942,8 @@
if (QuicVersionHasLongHeaderLengths(
peer_framer_.version().transport_version)) {
header.long_packet_type = INITIAL;
- header.retry_token_length_length = VARIABLE_LENGTH_INTEGER_LENGTH_1;
- header.length_length = VARIABLE_LENGTH_INTEGER_LENGTH_2;
+ header.retry_token_length_length = quiche::VARIABLE_LENGTH_INTEGER_LENGTH_1;
+ header.length_length = quiche::VARIABLE_LENGTH_INTEGER_LENGTH_2;
}
QuicFrames frames;