Migration from GFE_BUG_V2 (and friends) to GFE_BUG
Per go/gfe-bug-improvements GFE_BUGs are getting stable IDs to allow for monitoring and alerting. To achieve that, a temporary set of V2 macros was added and the codebase was migrated to using the V2 macros. Now that migration is complete, the old-style (sans _V2) macros were changed to also take bug_id parameter, which makes the V2 set obsolete. To complete the transition, the codebase is being migrated back to GFE_BUG macros. Once done, V2 macros will be removed.
PiperOrigin-RevId: 363282323
Change-Id: I449be0659402ebded0e12384b1bda9017e528b8f
diff --git a/quic/core/quic_crypto_client_stream.cc b/quic/core/quic_crypto_client_stream.cc
index dfa5b86..78d2f10 100644
--- a/quic/core/quic_crypto_client_stream.cc
+++ b/quic/core/quic_crypto_client_stream.cc
@@ -49,7 +49,7 @@
proof_handler, has_application_state);
break;
case PROTOCOL_UNSUPPORTED:
- QUIC_BUG_V2(quic_bug_10296_1)
+ QUIC_BUG(quic_bug_10296_1)
<< "Attempting to create QuicCryptoClientStream for unknown "
"handshake protocol";
}
diff --git a/quic/core/quic_crypto_server_stream_base.cc b/quic/core/quic_crypto_server_stream_base.cc
index 368f47b..708b175 100644
--- a/quic/core/quic_crypto_server_stream_base.cc
+++ b/quic/core/quic_crypto_server_stream_base.cc
@@ -42,7 +42,7 @@
case PROTOCOL_UNSUPPORTED:
break;
}
- QUIC_BUG_V2(quic_bug_10492_1)
+ QUIC_BUG(quic_bug_10492_1)
<< "Unknown handshake protocol: "
<< static_cast<int>(session->connection()->version().handshake_protocol);
return nullptr;
diff --git a/quic/core/quic_crypto_stream.cc b/quic/core/quic_crypto_stream.cc
index 93e4ca4..f8f34df 100644
--- a/quic/core/quic_crypto_stream.cc
+++ b/quic/core/quic_crypto_stream.cc
@@ -71,8 +71,8 @@
}
void QuicCryptoStream::OnCryptoFrame(const QuicCryptoFrame& frame) {
- QUIC_BUG_IF_V2(quic_bug_12573_1,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_1,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 shouldn't receive CRYPTO frames";
EncryptionLevel level = session()->connection()->last_decrypted_level();
substreams_[level].sequencer.OnCryptoFrame(frame);
@@ -86,7 +86,7 @@
void QuicCryptoStream::OnStreamFrame(const QuicStreamFrame& frame) {
if (QuicVersionUsesCryptoFrames(session()->transport_version())) {
- QUIC_PEER_BUG_V2(quic_peer_bug_12573_2)
+ QUIC_PEER_BUG(quic_peer_bug_12573_2)
<< "Crypto data received in stream frame instead of crypto frame";
OnUnrecoverableError(QUIC_INVALID_STREAM_DATA, "Unexpected stream frame");
}
@@ -156,7 +156,7 @@
return;
}
if (data.empty()) {
- QUIC_BUG_V2(quic_bug_10322_1) << "Empty crypto data being written";
+ QUIC_BUG(quic_bug_10322_1) << "Empty crypto data being written";
return;
}
const bool had_buffered_data = HasBufferedCryptoFrames();
@@ -167,7 +167,7 @@
send_buffer->SaveStreamData(&iov, /*iov_count=*/1, /*iov_offset=*/0,
data.length());
if (kMaxStreamLength - offset < data.length()) {
- QUIC_BUG_V2(quic_bug_10322_2) << "Writing too much crypto handshake data";
+ QUIC_BUG(quic_bug_10322_2) << "Writing too much crypto handshake data";
// TODO(nharper): Switch this to an IETF QUIC error code, possibly
// INTERNAL_ERROR?
OnUnrecoverableError(QUIC_STREAM_LENGTH_OVERFLOW,
@@ -232,7 +232,7 @@
void QuicCryptoStream::OnStreamDataConsumed(QuicByteCount bytes_consumed) {
if (QuicVersionUsesCryptoFrames(session()->transport_version())) {
- QUIC_BUG_V2(quic_bug_10322_3)
+ QUIC_BUG(quic_bug_10322_3)
<< "Stream data consumed when CRYPTO frames should be in use";
}
if (bytes_consumed > 0) {
@@ -265,8 +265,8 @@
}
void QuicCryptoStream::WritePendingCryptoRetransmission() {
- QUIC_BUG_IF_V2(quic_bug_12573_3,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_3,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 don't write CRYPTO frames";
for (EncryptionLevel level : AllEncryptionLevels()) {
QuicStreamSendBuffer* send_buffer = &substreams_[level].send_buffer;
@@ -384,16 +384,16 @@
QuicStreamOffset offset,
QuicByteCount data_length,
QuicDataWriter* writer) {
- QUIC_BUG_IF_V2(quic_bug_12573_4,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_4,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 don't write CRYPTO frames (2)";
return substreams_[level].send_buffer.WriteStreamData(offset, data_length,
writer);
}
void QuicCryptoStream::OnCryptoFrameLost(QuicCryptoFrame* crypto_frame) {
- QUIC_BUG_IF_V2(quic_bug_12573_5,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_5,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 don't lose CRYPTO frames";
substreams_[crypto_frame->level].send_buffer.OnStreamDataLost(
crypto_frame->offset, crypto_frame->data_length);
@@ -401,8 +401,8 @@
void QuicCryptoStream::RetransmitData(QuicCryptoFrame* crypto_frame,
TransmissionType type) {
- QUIC_BUG_IF_V2(quic_bug_12573_6,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_6,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 don't retransmit CRYPTO frames";
QuicIntervalSet<QuicStreamOffset> retransmission(
crypto_frame->offset, crypto_frame->offset + crypto_frame->data_length);
@@ -427,8 +427,8 @@
}
void QuicCryptoStream::WriteBufferedCryptoFrames() {
- QUIC_BUG_IF_V2(quic_bug_12573_7,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_7,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 don't use CRYPTO frames";
for (EncryptionLevel level : AllEncryptionLevels()) {
QuicStreamSendBuffer* send_buffer = &substreams_[level].send_buffer;
@@ -450,8 +450,8 @@
}
bool QuicCryptoStream::HasBufferedCryptoFrames() const {
- QUIC_BUG_IF_V2(quic_bug_12573_8,
- !QuicVersionUsesCryptoFrames(session()->transport_version()))
+ QUIC_BUG_IF(quic_bug_12573_8,
+ !QuicVersionUsesCryptoFrames(session()->transport_version()))
<< "Versions less than 47 don't use CRYPTO frames";
for (EncryptionLevel level : AllEncryptionLevels()) {
const QuicStreamSendBuffer& send_buffer = substreams_[level].send_buffer;
diff --git a/quic/core/quic_data_writer.cc b/quic/core/quic_data_writer.cc
index 578eea5..ee3c861 100644
--- a/quic/core/quic_data_writer.cc
+++ b/quic/core/quic_data_writer.cc
@@ -201,8 +201,8 @@
const QuicVariableLengthIntegerLength min_length = GetVarInt62Len(value);
if (write_length < min_length) {
- QUIC_BUG_V2(quic_bug_10347_1) << "Cannot write value " << value
- << " with write_length " << write_length;
+ QUIC_BUG(quic_bug_10347_1) << "Cannot write value " << value
+ << " with write_length " << write_length;
return false;
}
if (write_length == min_length) {
@@ -220,7 +220,7 @@
WriteUInt32(value);
}
- QUIC_BUG_V2(quic_bug_10347_2)
+ QUIC_BUG(quic_bug_10347_2)
<< "Invalid write_length " << static_cast<int>(write_length);
return false;
}
@@ -228,8 +228,8 @@
// static
QuicVariableLengthIntegerLength QuicDataWriter::GetVarInt62Len(uint64_t value) {
if ((value & kVarInt62ErrorMask) != 0) {
- QUIC_BUG_V2(quic_bug_10347_3) << "Attempted to encode a value, " << value
- << ", that is too big for VarInt62";
+ QUIC_BUG(quic_bug_10347_3) << "Attempted to encode a value, " << value
+ << ", that is too big for VarInt62";
return VARIABLE_LENGTH_INTEGER_LENGTH_0;
}
if ((value & kVarInt62Mask8Bytes) != 0) {
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc
index ab5a147..73d636a 100644
--- a/quic/core/quic_dispatcher.cc
+++ b/quic/core/quic_dispatcher.cc
@@ -176,7 +176,7 @@
/*transport_close_frame_type=*/0);
if (!creator_.AddFrame(QuicFrame(frame), NOT_RETRANSMISSION)) {
- QUIC_BUG_V2(quic_bug_10287_1) << "Unable to add frame to an empty packet";
+ QUIC_BUG(quic_bug_10287_1) << "Unable to add frame to an empty packet";
delete frame;
return;
}
@@ -265,7 +265,7 @@
}
if (legacy_version_encapsulation_inner_packet.length() >=
packet_info.packet.length()) {
- QUIC_BUG_V2(quic_bug_10287_2)
+ QUIC_BUG(quic_bug_10287_2)
<< "Inner packet cannot be larger than outer "
<< legacy_version_encapsulation_inner_packet.length() << " vs "
<< packet_info.packet.length();
@@ -328,7 +328,7 @@
if (use_reference_counted_session_map_) {
QUIC_RESTART_FLAG_COUNT(quic_use_reference_counted_sesssion_map);
}
- QUIC_BUG_IF_V2(quic_bug_12724_1, GetSupportedVersions().empty())
+ QUIC_BUG_IF(quic_bug_12724_1, GetSupportedVersions().empty())
<< "Trying to create dispatcher without any supported versions";
QUIC_DLOG(INFO) << "Created QuicDispatcher with versions: "
<< ParsedQuicVersionVectorToString(GetSupportedVersions());
@@ -917,7 +917,7 @@
if (!write_blocked_list_.empty()) {
for (const auto& session : closed_ref_counted_session_list_) {
if (write_blocked_list_.erase(session->connection()) != 0) {
- QUIC_BUG_V2(quic_bug_12724_2)
+ QUIC_BUG(quic_bug_12724_2)
<< "QuicConnection was in WriteBlockedList before destruction "
<< session->connection()->connection_id();
}
@@ -928,7 +928,7 @@
if (!write_blocked_list_.empty()) {
for (const std::unique_ptr<QuicSession>& session : closed_session_list_) {
if (write_blocked_list_.erase(session->connection()) != 0) {
- QUIC_BUG_V2(quic_bug_12724_3)
+ QUIC_BUG(quic_bug_12724_3)
<< "QuicConnection was in WriteBlockedList before destruction "
<< session->connection()->connection_id();
}
@@ -1004,11 +1004,11 @@
if (use_reference_counted_session_map_) {
auto it = reference_counted_session_map_.find(server_connection_id);
if (it == reference_counted_session_map_.end()) {
- QUIC_BUG_V2(quic_bug_10287_3)
+ QUIC_BUG(quic_bug_10287_3)
<< "ConnectionId " << server_connection_id
<< " does not exist in the session map. Error: "
<< QuicErrorCodeToString(error);
- QUIC_BUG_V2(quic_bug_10287_4) << QuicStackTrace();
+ QUIC_BUG(quic_bug_10287_4) << QuicStackTrace();
return;
}
@@ -1042,11 +1042,11 @@
} else {
auto it = session_map_.find(server_connection_id);
if (it == session_map_.end()) {
- QUIC_BUG_V2(quic_bug_10287_5)
+ QUIC_BUG(quic_bug_10287_5)
<< "ConnectionId " << server_connection_id
<< " does not exist in the session map. Error: "
<< QuicErrorCodeToString(error);
- QUIC_BUG_V2(quic_bug_10287_6) << QuicStackTrace();
+ QUIC_BUG(quic_bug_10287_6) << QuicStackTrace();
return;
}
@@ -1075,7 +1075,7 @@
if (!blocked_writer->IsWriterBlocked()) {
// It is a programming error if this ever happens. When we are sure it is
// not happening, replace it with a QUICHE_DCHECK.
- QUIC_BUG_V2(quic_bug_12724_4)
+ QUIC_BUG(quic_bug_12724_4)
<< "Tried to add writer into blocked list when it shouldn't be added";
// Return without adding the connection to the blocked list, to avoid
// infinite loops in OnCanWrite.
@@ -1096,7 +1096,7 @@
QUICHE_DCHECK(support_multiple_cid_per_connection_);
auto it = reference_counted_session_map_.find(server_connection_id);
if (it == reference_counted_session_map_.end()) {
- QUIC_BUG_V2(quic_bug_10287_7)
+ QUIC_BUG(quic_bug_10287_7)
<< "Couldn't locate the session that issues the connection ID in "
"reference_counted_session_map_. server_connection_id:"
<< server_connection_id << " new_connection_id: " << new_connection_id;
@@ -1230,7 +1230,7 @@
std::make_pair(server_connection_id,
std::shared_ptr<QuicSession>(std::move(session))));
if (!insertion_result.second) {
- QUIC_BUG_V2(quic_bug_12724_5)
+ QUIC_BUG(quic_bug_12724_5)
<< "Tried to add a session to session_map with existing connection "
"id: "
<< server_connection_id;
@@ -1241,7 +1241,7 @@
} else {
auto insertion_result = session_map_.insert(
std::make_pair(server_connection_id, std::move(session)));
- QUIC_BUG_IF_V2(quic_bug_12724_6, !insertion_result.second)
+ QUIC_BUG_IF(quic_bug_12724_6, !insertion_result.second)
<< "Tried to add a session to session_map with existing connection "
"id: "
<< server_connection_id;
@@ -1306,9 +1306,8 @@
if (GetQuicFlag(FLAGS_quic_allow_chlo_buffering) &&
new_sessions_allowed_per_event_loop_ <= 0) {
// Can't create new session any more. Wait till next event loop.
- QUIC_BUG_IF_V2(quic_bug_12724_7,
- buffered_packets_.HasChloForConnection(
- packet_info->destination_connection_id));
+ QUIC_BUG_IF(quic_bug_12724_7, buffered_packets_.HasChloForConnection(
+ packet_info->destination_connection_id));
EnqueuePacketResult rs = buffered_packets_.EnqueuePacket(
packet_info->destination_connection_id,
packet_info->form != GOOGLE_QUIC_PACKET, packet_info->packet,
@@ -1330,7 +1329,7 @@
packet_info->destination_connection_id, packet_info->self_address,
packet_info->peer_address, alpn, packet_info->version);
if (QUIC_PREDICT_FALSE(session == nullptr)) {
- QUIC_BUG_V2(quic_bug_10287_8)
+ QUIC_BUG(quic_bug_10287_8)
<< "CreateQuicSession returned nullptr for "
<< packet_info->destination_connection_id << " from "
<< packet_info->peer_address << " to " << packet_info->self_address
@@ -1351,7 +1350,7 @@
packet_info->destination_connection_id,
std::shared_ptr<QuicSession>(std::move(session.release()))));
if (!insertion_result.second) {
- QUIC_BUG_V2(quic_bug_10287_9)
+ QUIC_BUG(quic_bug_10287_9)
<< "Tried to add a session to session_map with existing "
"connection id: "
<< packet_info->destination_connection_id;
@@ -1362,7 +1361,7 @@
} else {
auto insertion_result = session_map_.insert(std::make_pair(
packet_info->destination_connection_id, std::move(session)));
- QUIC_BUG_IF_V2(quic_bug_12724_8, !insertion_result.second)
+ QUIC_BUG_IF(quic_bug_12724_8, !insertion_result.second)
<< "Tried to add a session to session_map with existing connection id: "
<< packet_info->destination_connection_id;
session_ptr = insertion_result.first->second.get();
diff --git a/quic/core/quic_flow_controller.cc b/quic/core/quic_flow_controller.cc
index 53202bf..88dc3ed 100644
--- a/quic/core/quic_flow_controller.cc
+++ b/quic/core/quic_flow_controller.cc
@@ -91,7 +91,7 @@
void QuicFlowController::AddBytesSent(QuicByteCount bytes_sent) {
if (bytes_sent_ + bytes_sent > send_window_offset_) {
- QUIC_BUG_V2(quic_bug_10836_1)
+ QUIC_BUG(quic_bug_10836_1)
<< ENDPOINT << LogLabel() << " Trying to send an extra " << bytes_sent
<< " bytes, when bytes_sent = " << bytes_sent_
<< ", and send_window_offset_ = " << send_window_offset_;
@@ -299,7 +299,7 @@
QUIC_DVLOG(1) << ENDPOINT << "UpdateReceiveWindowSize for " << LogLabel()
<< ": " << size;
if (receive_window_size_ != receive_window_offset_) {
- QUIC_BUG_V2(quic_bug_10836_2)
+ QUIC_BUG(quic_bug_10836_2)
<< "receive_window_size_:" << receive_window_size_
<< " != receive_window_offset:" << receive_window_offset_;
return;
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc
index 25f8a55..36d1cca 100644
--- a/quic/core/quic_framer.cc
+++ b/quic/core/quic_framer.cc
@@ -166,7 +166,7 @@
case PACKET_FLAGS_1BYTE_PACKET:
return PACKET_1BYTE_PACKET_NUMBER;
default:
- QUIC_BUG_V2(quic_bug_10850_1) << "Unreachable case statement.";
+ QUIC_BUG(quic_bug_10850_1) << "Unreachable case statement.";
return PACKET_6BYTE_PACKET_NUMBER;
}
}
@@ -183,7 +183,7 @@
case PACKET_FLAGS_1BYTE_PACKET:
return PACKET_1BYTE_PACKET_NUMBER;
default:
- QUIC_BUG_V2(quic_bug_10850_2) << "Unreachable case statement.";
+ QUIC_BUG(quic_bug_10850_2) << "Unreachable case statement.";
return PACKET_6BYTE_PACKET_NUMBER;
}
}
@@ -211,7 +211,7 @@
case VERSION_NEGOTIATION:
return 0xF0; // Value does not matter
default:
- QUIC_BUG_V2(quic_bug_10850_3) << "Invalid long header type: " << type;
+ QUIC_BUG(quic_bug_10850_3) << "Invalid long header type: " << type;
return 0xFF;
}
}
@@ -232,7 +232,7 @@
*long_header_type = RETRY;
break;
default:
- QUIC_BUG_V2(quic_bug_10850_4) << "Unreachable statement";
+ QUIC_BUG(quic_bug_10850_4) << "Unreachable statement";
*long_header_type = INVALID_PACKET_TYPE;
return false;
}
@@ -247,7 +247,7 @@
PacketNumberSpace GetPacketNumberSpace(const QuicPacketHeader& header) {
switch (header.form) {
case GOOGLE_QUIC_PACKET:
- QUIC_BUG_V2(quic_bug_10850_5)
+ QUIC_BUG(quic_bug_10850_5)
<< "Try to get packet number space of Google QUIC packet";
break;
case IETF_QUIC_SHORT_HEADER_PACKET:
@@ -263,7 +263,7 @@
case VERSION_NEGOTIATION:
case RETRY:
case INVALID_PACKET_TYPE:
- QUIC_BUG_V2(quic_bug_10850_6)
+ QUIC_BUG(quic_bug_10850_6)
<< "Try to get packet number space of long header type: "
<< QuicUtils::QuicLongHeaderTypetoString(header.long_packet_type);
break;
@@ -276,7 +276,7 @@
EncryptionLevel GetEncryptionLevel(const QuicPacketHeader& header) {
switch (header.form) {
case GOOGLE_QUIC_PACKET:
- QUIC_BUG_V2(quic_bug_10850_7)
+ QUIC_BUG(quic_bug_10850_7)
<< "Cannot determine EncryptionLevel from Google QUIC header";
break;
case IETF_QUIC_SHORT_HEADER_PACKET:
@@ -292,7 +292,7 @@
case VERSION_NEGOTIATION:
case RETRY:
case INVALID_PACKET_TYPE:
- QUIC_BUG_V2(quic_bug_10850_8)
+ QUIC_BUG(quic_bug_10850_8)
<< "No encryption used with type "
<< QuicUtils::QuicLongHeaderTypetoString(header.long_packet_type);
}
@@ -472,7 +472,7 @@
size_t QuicFramer::GetMessageFrameSize(QuicTransportVersion version,
bool last_frame_in_packet,
QuicByteCount length) {
- QUIC_BUG_IF_V2(quic_bug_12975_1, !VersionSupportsMessageFrames(version))
+ QUIC_BUG_IF(quic_bug_12975_1, !VersionSupportsMessageFrames(version))
<< "Try to serialize MESSAGE frame in " << version;
return kQuicFrameTypeSize +
(last_frame_in_packet ? 0 : QuicDataWriter::GetVarInt62Len(length)) +
@@ -592,7 +592,7 @@
size_t QuicFramer::GetMaxStreamsFrameSize(QuicTransportVersion version,
const QuicMaxStreamsFrame& frame) {
if (!VersionHasIetfQuicFrames(version)) {
- QUIC_BUG_V2(quic_bug_10850_9)
+ QUIC_BUG(quic_bug_10850_9)
<< "In version " << version
<< ", which does not support IETF Frames, and tried to serialize "
"MaxStreams Frame.";
@@ -606,7 +606,7 @@
QuicTransportVersion version,
const QuicStreamsBlockedFrame& frame) {
if (!VersionHasIetfQuicFrames(version)) {
- QUIC_BUG_V2(quic_bug_10850_10)
+ QUIC_BUG(quic_bug_10850_10)
<< "In version " << version
<< ", which does not support IETF frames, and tried to serialize "
"StreamsBlocked Frame.";
@@ -730,7 +730,7 @@
return i;
}
}
- QUIC_BUG_V2(quic_bug_10850_11) << "Failed to determine StreamIDSize.";
+ QUIC_BUG(quic_bug_10850_11) << "Failed to determine StreamIDSize.";
return 4;
}
@@ -748,7 +748,7 @@
return i;
}
}
- QUIC_BUG_V2(quic_bug_10850_12) << "Failed to determine StreamOffsetSize.";
+ QUIC_BUG(quic_bug_10850_12) << "Failed to determine StreamOffsetSize.";
return 8;
}
@@ -804,7 +804,7 @@
QuicPacketNumberLength packet_number_length) {
// Prevent a rare crash reported in b/19458523.
if (frame.type == ACK_FRAME && frame.ack_frame == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_13)
+ QUIC_BUG(quic_bug_10850_13)
<< "Cannot compute the length of a null ack frame. free_bytes:"
<< free_bytes << " first_frame:" << first_frame
<< " last_frame:" << last_frame
@@ -871,7 +871,7 @@
writer->length() - length_field_offset <
kQuicDefaultLongHeaderLengthLength) {
set_detailed_error("Invalid length_field_offset.");
- QUIC_BUG_V2(quic_bug_10850_14) << "Invalid length_field_offset.";
+ QUIC_BUG(quic_bug_10850_14) << "Invalid length_field_offset.";
return false;
}
size_t length_to_write = writer->length() - length_field_offset -
@@ -884,7 +884,7 @@
if (!length_writer.WriteVarInt62(length_to_write,
kQuicDefaultLongHeaderLengthLength)) {
set_detailed_error("Failed to overwrite long header length.");
- QUIC_BUG_V2(quic_bug_10850_15) << "Failed to overwrite long header length.";
+ QUIC_BUG(quic_bug_10850_15) << "Failed to overwrite long header length.";
return false;
}
return true;
@@ -895,14 +895,14 @@
char* buffer,
size_t packet_length,
EncryptionLevel level) {
- QUIC_BUG_IF_V2(quic_bug_12975_2,
- header.version_flag && version().HasIetfInvariantHeader() &&
- header.long_packet_type == RETRY && !frames.empty())
+ QUIC_BUG_IF(quic_bug_12975_2,
+ header.version_flag && version().HasIetfInvariantHeader() &&
+ header.long_packet_type == RETRY && !frames.empty())
<< "IETF RETRY packets cannot contain frames " << header;
QuicDataWriter writer(packet_length, buffer);
size_t length_field_offset = 0;
if (!AppendPacketHeader(header, &writer, &length_field_offset)) {
- QUIC_BUG_V2(quic_bug_10850_16) << "AppendPacketHeader failed";
+ QUIC_BUG(quic_bug_10850_16) << "AppendPacketHeader failed";
return 0;
}
@@ -922,14 +922,14 @@
// Determine if we should write stream frame length in header.
const bool last_frame_in_packet = i == frames.size() - 1;
if (!AppendTypeByte(frame, last_frame_in_packet, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_17) << "AppendTypeByte failed";
+ QUIC_BUG(quic_bug_10850_17) << "AppendTypeByte failed";
return 0;
}
switch (frame.type) {
case PADDING_FRAME:
if (!AppendPaddingFrame(frame.padding_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_18)
+ QUIC_BUG(quic_bug_10850_18)
<< "AppendPaddingFrame of "
<< frame.padding_frame.num_padding_bytes << " failed";
return 0;
@@ -938,13 +938,13 @@
case STREAM_FRAME:
if (!AppendStreamFrame(frame.stream_frame, last_frame_in_packet,
&writer)) {
- QUIC_BUG_V2(quic_bug_10850_19) << "AppendStreamFrame failed";
+ QUIC_BUG(quic_bug_10850_19) << "AppendStreamFrame failed";
return 0;
}
break;
case ACK_FRAME:
if (!AppendAckFrameAndTypeByte(*frame.ack_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_20)
+ QUIC_BUG(quic_bug_10850_20)
<< "AppendAckFrameAndTypeByte failed: " << detailed_error_;
return 0;
}
@@ -952,7 +952,7 @@
case STOP_WAITING_FRAME:
if (!AppendStopWaitingFrame(header, frame.stop_waiting_frame,
&writer)) {
- QUIC_BUG_V2(quic_bug_10850_21) << "AppendStopWaitingFrame failed";
+ QUIC_BUG(quic_bug_10850_21) << "AppendStopWaitingFrame failed";
return 0;
}
break;
@@ -964,32 +964,32 @@
break;
case RST_STREAM_FRAME:
if (!AppendRstStreamFrame(*frame.rst_stream_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_22) << "AppendRstStreamFrame failed";
+ QUIC_BUG(quic_bug_10850_22) << "AppendRstStreamFrame failed";
return 0;
}
break;
case CONNECTION_CLOSE_FRAME:
if (!AppendConnectionCloseFrame(*frame.connection_close_frame,
&writer)) {
- QUIC_BUG_V2(quic_bug_10850_23) << "AppendConnectionCloseFrame failed";
+ QUIC_BUG(quic_bug_10850_23) << "AppendConnectionCloseFrame failed";
return 0;
}
break;
case GOAWAY_FRAME:
if (!AppendGoAwayFrame(*frame.goaway_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_24) << "AppendGoAwayFrame failed";
+ QUIC_BUG(quic_bug_10850_24) << "AppendGoAwayFrame failed";
return 0;
}
break;
case WINDOW_UPDATE_FRAME:
if (!AppendWindowUpdateFrame(*frame.window_update_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_25) << "AppendWindowUpdateFrame failed";
+ QUIC_BUG(quic_bug_10850_25) << "AppendWindowUpdateFrame failed";
return 0;
}
break;
case BLOCKED_FRAME:
if (!AppendBlockedFrame(*frame.blocked_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_26) << "AppendBlockedFrame failed";
+ QUIC_BUG(quic_bug_10850_26) << "AppendBlockedFrame failed";
return 0;
}
break;
@@ -1029,7 +1029,7 @@
case MESSAGE_FRAME:
if (!AppendMessageFrameAndTypeByte(*frame.message_frame,
last_frame_in_packet, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_27) << "AppendMessageFrame failed";
+ QUIC_BUG(quic_bug_10850_27) << "AppendMessageFrame failed";
return 0;
}
break;
@@ -1040,7 +1040,7 @@
return RaiseError(QUIC_INTERNAL_ERROR);
}
if (!AppendCryptoFrame(*frame.crypto_frame, &writer)) {
- QUIC_BUG_V2(quic_bug_10850_28) << "AppendCryptoFrame failed";
+ QUIC_BUG(quic_bug_10850_28) << "AppendCryptoFrame failed";
return 0;
}
break;
@@ -1049,7 +1049,7 @@
break;
default:
RaiseError(QUIC_INVALID_FRAME_DATA);
- QUIC_BUG_V2(quic_bug_10850_29) << "QUIC_INVALID_FRAME_DATA";
+ QUIC_BUG(quic_bug_10850_29) << "QUIC_INVALID_FRAME_DATA";
return 0;
}
++i;
@@ -1069,7 +1069,7 @@
// Determine if we should write stream frame length in header.
const bool last_frame_in_packet = i == frames.size() - 1;
if (!AppendIetfFrameType(frame, last_frame_in_packet, writer)) {
- QUIC_BUG_V2(quic_bug_10850_30)
+ QUIC_BUG(quic_bug_10850_30)
<< "AppendIetfFrameType failed: " << detailed_error();
return 0;
}
@@ -1077,17 +1077,16 @@
switch (frame.type) {
case PADDING_FRAME:
if (!AppendPaddingFrame(frame.padding_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_31)
- << "AppendPaddingFrame of "
- << frame.padding_frame.num_padding_bytes
- << " failed: " << detailed_error();
+ QUIC_BUG(quic_bug_10850_31) << "AppendPaddingFrame of "
+ << frame.padding_frame.num_padding_bytes
+ << " failed: " << detailed_error();
return 0;
}
break;
case STREAM_FRAME:
if (!AppendStreamFrame(frame.stream_frame, last_frame_in_packet,
writer)) {
- QUIC_BUG_V2(quic_bug_10850_32)
+ QUIC_BUG(quic_bug_10850_32)
<< "AppendStreamFrame " << frame.stream_frame
<< " failed: " << detailed_error();
return 0;
@@ -1095,7 +1094,7 @@
break;
case ACK_FRAME:
if (!AppendIetfAckFrameAndTypeByte(*frame.ack_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_33)
+ QUIC_BUG(quic_bug_10850_33)
<< "AppendIetfAckFrameAndTypeByte failed: " << detailed_error();
return 0;
}
@@ -1104,7 +1103,7 @@
set_detailed_error(
"Attempt to append STOP WAITING frame in IETF QUIC.");
RaiseError(QUIC_INTERNAL_ERROR);
- QUIC_BUG_V2(quic_bug_10850_34) << detailed_error();
+ QUIC_BUG(quic_bug_10850_34) << detailed_error();
return 0;
case MTU_DISCOVERY_FRAME:
// MTU discovery frames are serialized as ping frames.
@@ -1114,7 +1113,7 @@
break;
case RST_STREAM_FRAME:
if (!AppendRstStreamFrame(*frame.rst_stream_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_35)
+ QUIC_BUG(quic_bug_10850_35)
<< "AppendRstStreamFrame failed: " << detailed_error();
return 0;
}
@@ -1122,7 +1121,7 @@
case CONNECTION_CLOSE_FRAME:
if (!AppendIetfConnectionCloseFrame(*frame.connection_close_frame,
writer)) {
- QUIC_BUG_V2(quic_bug_10850_36)
+ QUIC_BUG(quic_bug_10850_36)
<< "AppendIetfConnectionCloseFrame failed: " << detailed_error();
return 0;
}
@@ -1130,7 +1129,7 @@
case GOAWAY_FRAME:
set_detailed_error("Attempt to append GOAWAY frame in IETF QUIC.");
RaiseError(QUIC_INTERNAL_ERROR);
- QUIC_BUG_V2(quic_bug_10850_37) << detailed_error();
+ QUIC_BUG(quic_bug_10850_37) << detailed_error();
return 0;
case WINDOW_UPDATE_FRAME:
// Depending on whether there is a stream ID or not, will be either a
@@ -1138,13 +1137,13 @@
if (frame.window_update_frame->stream_id ==
QuicUtils::GetInvalidStreamId(transport_version())) {
if (!AppendMaxDataFrame(*frame.window_update_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_38)
+ QUIC_BUG(quic_bug_10850_38)
<< "AppendMaxDataFrame failed: " << detailed_error();
return 0;
}
} else {
if (!AppendMaxStreamDataFrame(*frame.window_update_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_39)
+ QUIC_BUG(quic_bug_10850_39)
<< "AppendMaxStreamDataFrame failed: " << detailed_error();
return 0;
}
@@ -1152,21 +1151,21 @@
break;
case BLOCKED_FRAME:
if (!AppendBlockedFrame(*frame.blocked_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_40)
+ QUIC_BUG(quic_bug_10850_40)
<< "AppendBlockedFrame failed: " << detailed_error();
return 0;
}
break;
case MAX_STREAMS_FRAME:
if (!AppendMaxStreamsFrame(frame.max_streams_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_41)
+ QUIC_BUG(quic_bug_10850_41)
<< "AppendMaxStreamsFrame failed: " << detailed_error();
return 0;
}
break;
case STREAMS_BLOCKED_FRAME:
if (!AppendStreamsBlockedFrame(frame.streams_blocked_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_42)
+ QUIC_BUG(quic_bug_10850_42)
<< "AppendStreamsBlockedFrame failed: " << detailed_error();
return 0;
}
@@ -1174,7 +1173,7 @@
case NEW_CONNECTION_ID_FRAME:
if (!AppendNewConnectionIdFrame(*frame.new_connection_id_frame,
writer)) {
- QUIC_BUG_V2(quic_bug_10850_43)
+ QUIC_BUG(quic_bug_10850_43)
<< "AppendNewConnectionIdFrame failed: " << detailed_error();
return 0;
}
@@ -1182,35 +1181,35 @@
case RETIRE_CONNECTION_ID_FRAME:
if (!AppendRetireConnectionIdFrame(*frame.retire_connection_id_frame,
writer)) {
- QUIC_BUG_V2(quic_bug_10850_44)
+ QUIC_BUG(quic_bug_10850_44)
<< "AppendRetireConnectionIdFrame failed: " << detailed_error();
return 0;
}
break;
case NEW_TOKEN_FRAME:
if (!AppendNewTokenFrame(*frame.new_token_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_45)
+ QUIC_BUG(quic_bug_10850_45)
<< "AppendNewTokenFrame failed: " << detailed_error();
return 0;
}
break;
case STOP_SENDING_FRAME:
if (!AppendStopSendingFrame(*frame.stop_sending_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_46)
+ QUIC_BUG(quic_bug_10850_46)
<< "AppendStopSendingFrame failed: " << detailed_error();
return 0;
}
break;
case PATH_CHALLENGE_FRAME:
if (!AppendPathChallengeFrame(*frame.path_challenge_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_47)
+ QUIC_BUG(quic_bug_10850_47)
<< "AppendPathChallengeFrame failed: " << detailed_error();
return 0;
}
break;
case PATH_RESPONSE_FRAME:
if (!AppendPathResponseFrame(*frame.path_response_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_48)
+ QUIC_BUG(quic_bug_10850_48)
<< "AppendPathResponseFrame failed: " << detailed_error();
return 0;
}
@@ -1218,14 +1217,14 @@
case MESSAGE_FRAME:
if (!AppendMessageFrameAndTypeByte(*frame.message_frame,
last_frame_in_packet, writer)) {
- QUIC_BUG_V2(quic_bug_10850_49)
+ QUIC_BUG(quic_bug_10850_49)
<< "AppendMessageFrame failed: " << detailed_error();
return 0;
}
break;
case CRYPTO_FRAME:
if (!AppendCryptoFrame(*frame.crypto_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_50)
+ QUIC_BUG(quic_bug_10850_50)
<< "AppendCryptoFrame failed: " << detailed_error();
return 0;
}
@@ -1235,7 +1234,7 @@
break;
case ACK_FREQUENCY_FRAME:
if (!AppendAckFrequencyFrame(*frame.ack_frequency_frame, writer)) {
- QUIC_BUG_V2(quic_bug_10850_51)
+ QUIC_BUG(quic_bug_10850_51)
<< "AppendAckFrequencyFrame failed: " << detailed_error();
return 0;
}
@@ -1243,7 +1242,7 @@
default:
set_detailed_error("Tried to append unknown frame type.");
RaiseError(QUIC_INVALID_FRAME_DATA);
- QUIC_BUG_V2(quic_bug_10850_52)
+ QUIC_BUG(quic_bug_10850_52)
<< "QUIC_INVALID_FRAME_DATA: " << frame.type;
return 0;
}
@@ -1312,7 +1311,7 @@
QUIC_DVLOG(1) << "Building IETF stateless reset packet.";
if (GetQuicReloadableFlag(quic_fix_stateless_reset)) {
if (received_packet_length <= GetMinStatelessResetPacketLength()) {
- QUIC_BUG_V2(362045737_1)
+ QUIC_BUG(362045737_1)
<< "Tried to build stateless reset packet with received packet "
"length "
<< received_packet_length;
@@ -1328,8 +1327,8 @@
// Append random bytes.
if (!writer.WriteInsecureRandomBytes(QuicRandom::GetInstance(),
len - sizeof(quic::QuicUint128))) {
- QUIC_BUG_V2(362045737_2) << "Failed to append random bytes of length: "
- << len - sizeof(quic::QuicUint128);
+ QUIC_BUG(362045737_2) << "Failed to append random bytes of length: "
+ << len - sizeof(quic::QuicUint128);
return nullptr;
}
// Change first 2 fixed bits to 01.
@@ -1339,7 +1338,7 @@
// Append stateless reset token.
if (!writer.WriteBytes(&stateless_reset_token,
sizeof(stateless_reset_token))) {
- QUIC_BUG_V2(362045737_3) << "Failed to write stateless reset token";
+ QUIC_BUG(362045737_3) << "Failed to write stateless reset token";
return nullptr;
}
QUIC_RELOADABLE_FLAG_COUNT(quic_fix_stateless_reset);
@@ -1603,7 +1602,7 @@
rv = ProcessDataPacket(&reader, &header, packet, large_buffer.get(),
packet.length());
}
- QUIC_BUG_IF_V2(quic_bug_10850_53, rv)
+ QUIC_BUG_IF(quic_bug_10850_53, rv)
<< "QUIC should never successfully process packets larger"
<< "than kMaxIncomingPacketSize. packet size:" << packet.length();
}
@@ -1784,7 +1783,7 @@
if (!encrypted_reader->TruncateRemaining(header->remaining_packet_length)) {
set_detailed_error("Length TruncateRemaining failed.");
- QUIC_BUG_V2(quic_bug_10850_54) << "Length TruncateRemaining failed.";
+ QUIC_BUG(quic_bug_10850_54) << "Length TruncateRemaining failed.";
return RaiseError(QUIC_INVALID_PACKET_HEADER);
}
return true;
@@ -2125,8 +2124,8 @@
bool QuicFramer::IsIetfStatelessResetPacket(
const QuicPacketHeader& header) const {
- QUIC_BUG_IF_V2(quic_bug_12975_3, header.has_possible_stateless_reset_token &&
- perspective_ != Perspective::IS_CLIENT)
+ QUIC_BUG_IF(quic_bug_12975_3, header.has_possible_stateless_reset_token &&
+ perspective_ != Perspective::IS_CLIENT)
<< "has_possible_stateless_reset_token can only be true at client side.";
return header.form == IETF_QUIC_SHORT_HEADER_PACKET &&
header.has_possible_stateless_reset_token &&
@@ -2154,7 +2153,7 @@
case NUM_PACKET_NUMBER_SPACES:
break;
}
- QUIC_BUG_V2(quic_bug_10850_55)
+ QUIC_BUG(quic_bug_10850_55)
<< ENDPOINT
<< "Try to send data of space: " << PacketNumberSpaceToString(space);
return false;
@@ -2162,7 +2161,7 @@
EncryptionLevel QuicFramer::GetEncryptionLevelToSendApplicationData() const {
if (!HasAnEncrypterForSpace(APPLICATION_DATA)) {
- QUIC_BUG_V2(quic_bug_12975_4)
+ QUIC_BUG(quic_bug_12975_4)
<< "Tried to get encryption level to send application data with no "
"encrypter available.";
return NUM_ENCRYPTION_LEVELS;
@@ -2214,9 +2213,9 @@
}
break;
case CONNECTION_ID_PRESENT:
- QUIC_BUG_IF_V2(quic_bug_12975_5,
- !QuicUtils::IsConnectionIdValidForVersion(
- server_connection_id, transport_version()))
+ QUIC_BUG_IF(quic_bug_12975_5,
+ !QuicUtils::IsConnectionIdValidForVersion(
+ server_connection_id, transport_version()))
<< "AppendPacketHeader: attempted to use connection ID "
<< server_connection_id << " which is invalid with version "
<< version();
@@ -2279,9 +2278,8 @@
QUIC_DVLOG(1) << ENDPOINT << "Appending IETF header: " << header;
QuicConnectionId server_connection_id =
GetServerConnectionIdAsSender(header, perspective_);
- QUIC_BUG_IF_V2(quic_bug_12975_6,
- !QuicUtils::IsConnectionIdValidForVersion(server_connection_id,
- transport_version()))
+ QUIC_BUG_IF(quic_bug_12975_6, !QuicUtils::IsConnectionIdValidForVersion(
+ server_connection_id, transport_version()))
<< "AppendIetfPacketHeader: attempted to use connection ID "
<< server_connection_id << " which is invalid with version " << version();
if (!AppendIetfHeaderTypeByte(header, writer)) {
@@ -2321,8 +2319,8 @@
}
// TODO(b/141924462) Remove this QUIC_BUG once we do support sending RETRY.
- QUIC_BUG_IF_V2(quic_bug_12975_7,
- header.version_flag && header.long_packet_type == RETRY)
+ QUIC_BUG_IF(quic_bug_12975_7,
+ header.version_flag && header.long_packet_type == RETRY)
<< "Sending IETF RETRY packets is not currently supported " << header;
if (QuicVersionHasLongHeaderLengths(transport_version()) &&
@@ -2547,7 +2545,7 @@
case PACKET_8BYTE_PACKET_NUMBER:
return PACKET_FLAGS_8BYTE_PACKET;
default:
- QUIC_BUG_V2(quic_bug_10850_56) << "Unreachable case statement.";
+ QUIC_BUG(quic_bug_10850_56) << "Unreachable case statement.";
return PACKET_FLAGS_8BYTE_PACKET;
}
}
@@ -3213,7 +3211,7 @@
case ENCRYPTION_FORWARD_SECURE:
return true;
default:
- QUIC_BUG_V2(quic_bug_10850_57) << "Unknown encryption level: " << level;
+ QUIC_BUG(quic_bug_10850_57) << "Unknown encryption level: " << level;
}
return false;
}
@@ -4430,7 +4428,7 @@
std::unique_ptr<QuicEncrypter> next_encrypter =
visitor_->CreateCurrentOneRttEncrypter();
if (!next_decrypter_ || !next_encrypter) {
- QUIC_BUG_V2(quic_bug_10850_58) << "Failed to create next crypters";
+ QUIC_BUG(quic_bug_10850_58) << "Failed to create next crypters";
return false;
}
key_update_performed_ = true;
@@ -4494,7 +4492,7 @@
char* buffer) {
QUICHE_DCHECK(packet_number.IsInitialized());
if (encrypter_[level] == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_59)
+ QUIC_BUG(quic_bug_10850_59)
<< ENDPOINT
<< "Attempted to encrypt in place without encrypter at level " << level;
RaiseError(QUIC_ENCRYPTION_FAILURE);
@@ -4549,14 +4547,14 @@
absl::string_view sample;
if (!sample_reader.Seek(sample_offset) ||
!sample_reader.ReadStringPiece(&sample, kHPSampleLen)) {
- QUIC_BUG_V2(quic_bug_10850_60)
+ QUIC_BUG(quic_bug_10850_60)
<< "Not enough bytes to sample: sample_offset " << sample_offset
<< ", sample len: " << kHPSampleLen << ", buffer len: " << buffer_len;
return false;
}
if (encrypter_[level] == nullptr) {
- QUIC_BUG_V2(quic_bug_12975_8)
+ QUIC_BUG(quic_bug_12975_8)
<< ENDPOINT
<< "Attempted to apply header protection without encrypter at level "
<< level << " using " << version_;
@@ -4565,8 +4563,7 @@
std::string mask = encrypter_[level]->GenerateHeaderProtectionMask(sample);
if (mask.empty()) {
- QUIC_BUG_V2(quic_bug_10850_61)
- << "Unable to generate header protection mask.";
+ QUIC_BUG(quic_bug_10850_61) << "Unable to generate header protection mask.";
return false;
}
QuicDataReader mask_reader(mask.data(), mask.size());
@@ -4595,7 +4592,7 @@
perspective_ == Perspective::IS_SERVER &&
version_.handshake_protocol == PROTOCOL_QUIC_CRYPTO) {
if (pn_offset <= kDiversificationNonceSize) {
- QUIC_BUG_V2(quic_bug_10850_62)
+ QUIC_BUG(quic_bug_10850_62)
<< "Expected diversification nonce, but not enough bytes";
return false;
}
@@ -4751,7 +4748,7 @@
size_t buffer_len) {
QUICHE_DCHECK(packet_number.IsInitialized());
if (encrypter_[level] == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_63)
+ QUIC_BUG(quic_bug_10850_63)
<< ENDPOINT << "Attempted to encrypt without encrypter at level "
<< level;
RaiseError(QUIC_ENCRYPTION_FAILURE);
@@ -4764,7 +4761,7 @@
// plaintext content.
const size_t ad_len = associated_data.length();
if (packet.length() < ad_len) {
- QUIC_BUG_V2(quic_bug_10850_64)
+ QUIC_BUG(quic_bug_10850_64)
<< ENDPOINT << "packet is shorter than associated data length. version:"
<< version() << ", packet length:" << packet.length()
<< ", associated data length:" << ad_len;
@@ -4794,7 +4791,7 @@
size_t QuicFramer::GetCiphertextSize(EncryptionLevel level,
size_t plaintext_size) const {
if (encrypter_[level] == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_65)
+ QUIC_BUG(quic_bug_10850_65)
<< ENDPOINT
<< "Attempted to get ciphertext size without encrypter at level "
<< level << " using " << version_;
@@ -4822,7 +4819,7 @@
QuicPacketCount QuicFramer::GetOneRttEncrypterConfidentialityLimit() const {
if (!encrypter_[ENCRYPTION_FORWARD_SECURE]) {
- QUIC_BUG_V2(quic_bug_10850_66) << "1-RTT encrypter not set";
+ QUIC_BUG(quic_bug_10850_66) << "1-RTT encrypter not set";
return 0;
}
return encrypter_[ENCRYPTION_FORWARD_SECURE]->GetConfidentialityLimit();
@@ -4837,7 +4834,7 @@
size_t* decrypted_length,
EncryptionLevel* decrypted_level) {
if (!EncryptionLevelIsValid(decrypter_level_)) {
- QUIC_BUG_V2(quic_bug_10850_67)
+ QUIC_BUG(quic_bug_10850_67)
<< "Attempted to decrypt with bad decrypter_level_";
return false;
}
@@ -4849,14 +4846,14 @@
bool attempt_key_update = false;
if (version().KnowsWhichDecrypterToUse()) {
if (header.form == GOOGLE_QUIC_PACKET) {
- QUIC_BUG_V2(quic_bug_10850_68)
+ QUIC_BUG(quic_bug_10850_68)
<< "Attempted to decrypt GOOGLE_QUIC_PACKET with a version that "
"knows which decrypter to use";
return false;
}
level = GetEncryptionLevel(header);
if (!EncryptionLevelIsValid(level)) {
- QUIC_BUG_V2(quic_bug_10850_69) << "Attempted to decrypt with bad level";
+ QUIC_BUG(quic_bug_10850_69) << "Attempted to decrypt with bad level";
return false;
}
decrypter = decrypter_[level].get();
@@ -4888,8 +4885,7 @@
next_decrypter_ =
visitor_->AdvanceKeysAndCreateCurrentOneRttDecrypter();
if (!next_decrypter_) {
- QUIC_BUG_V2(quic_bug_10850_70)
- << "Failed to create next_decrypter";
+ QUIC_BUG(quic_bug_10850_70) << "Failed to create next_decrypter";
return false;
}
}
@@ -4914,7 +4910,7 @@
}
} else if (alternative_decrypter_level_ != NUM_ENCRYPTION_LEVELS) {
if (!EncryptionLevelIsValid(alternative_decrypter_level_)) {
- QUIC_BUG_V2(quic_bug_10850_71)
+ QUIC_BUG(quic_bug_10850_71)
<< "Attempted to decrypt with bad alternative_decrypter_level_";
return false;
}
@@ -4922,7 +4918,7 @@
}
if (decrypter == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_72)
+ QUIC_BUG(quic_bug_10850_72)
<< "Attempting to decrypt without decrypter, encryption level:" << level
<< " version:" << version();
return false;
@@ -4995,7 +4991,7 @@
*decrypted_level = decrypter_level_;
if (alternative_decrypter_latch_) {
if (!EncryptionLevelIsValid(alternative_decrypter_level_)) {
- QUIC_BUG_V2(quic_bug_10850_73)
+ QUIC_BUG(quic_bug_10850_73)
<< "Attempted to latch alternate decrypter with bad "
"alternative_decrypter_level_";
return false;
@@ -5032,7 +5028,7 @@
ack_frame_size += QuicDataWriter::GetVarInt62Len(ack_delay_time_us);
if (frame.packets.Empty() || frame.packets.Max() != largest_acked) {
- QUIC_BUG_V2(quic_bug_10850_74) << "Malformed ack frame";
+ QUIC_BUG(quic_bug_10850_74) << "Malformed ack frame";
// ACK frame serialization will fail and connection will be closed.
return ack_frame_size;
}
@@ -5315,7 +5311,7 @@
type_byte = IETF_ACK_FREQUENCY;
break;
default:
- QUIC_BUG_V2(quic_bug_10850_75)
+ QUIC_BUG(quic_bug_10850_75)
<< "Attempt to generate a frame type for an unsupported value: "
<< frame.type;
return false;
@@ -5329,7 +5325,7 @@
QuicDataWriter* writer) {
QUICHE_DCHECK(packet_number.IsInitialized());
if (!IsValidPacketNumberLength(packet_number_length)) {
- QUIC_BUG_V2(quic_bug_10850_76)
+ QUIC_BUG(quic_bug_10850_76)
<< "Invalid packet_number_length: " << packet_number_length;
return false;
}
@@ -5342,7 +5338,7 @@
QuicStreamId stream_id,
QuicDataWriter* writer) {
if (stream_id_length == 0 || stream_id_length > 4) {
- QUIC_BUG_V2(quic_bug_10850_77)
+ QUIC_BUG(quic_bug_10850_77)
<< "Invalid stream_id_length: " << stream_id_length;
return false;
}
@@ -5354,7 +5350,7 @@
QuicStreamOffset offset,
QuicDataWriter* writer) {
if (offset_length == 1 || offset_length > 8) {
- QUIC_BUG_V2(quic_bug_10850_78)
+ QUIC_BUG(quic_bug_10850_78)
<< "Invalid stream_offset_length: " << offset_length;
return false;
}
@@ -5369,7 +5365,7 @@
QuicDataWriter* writer) {
if (length == 0) {
if (!IsValidPacketNumberLength(length_length)) {
- QUIC_BUG_V2(quic_bug_10850_79)
+ QUIC_BUG(quic_bug_10850_79)
<< "Invalid packet_number_length: " << length_length;
return false;
}
@@ -5388,12 +5384,12 @@
}
if (!AppendStreamId(GetStreamIdSize(frame.stream_id), frame.stream_id,
writer)) {
- QUIC_BUG_V2(quic_bug_10850_80) << "Writing stream id size failed.";
+ QUIC_BUG(quic_bug_10850_80) << "Writing stream id size failed.";
return false;
}
if (!AppendStreamOffset(GetStreamOffsetSize(frame.offset), frame.offset,
writer)) {
- QUIC_BUG_V2(quic_bug_10850_81) << "Writing offset size failed.";
+ QUIC_BUG(quic_bug_10850_81) << "Writing offset size failed.";
return false;
}
if (!no_stream_frame_length) {
@@ -5403,7 +5399,7 @@
"If frame.data_length can hold more than a uint16_t than we need to "
"check that frame.data_length <= std::numeric_limits<uint16_t>::max()");
if (!writer->WriteUInt16(static_cast<uint16_t>(frame.data_length))) {
- QUIC_BUG_V2(quic_bug_10850_82) << "Writing stream frame length failed";
+ QUIC_BUG(quic_bug_10850_82) << "Writing stream frame length failed";
return false;
}
}
@@ -5416,14 +5412,14 @@
if (data_producer_->WriteStreamData(frame.stream_id, frame.offset,
frame.data_length,
writer) != WRITE_SUCCESS) {
- QUIC_BUG_V2(quic_bug_10850_83) << "Writing frame data failed.";
+ QUIC_BUG(quic_bug_10850_83) << "Writing frame data failed.";
return false;
}
return true;
}
if (!writer->WriteBytes(frame.data_buffer, frame.data_length)) {
- QUIC_BUG_V2(quic_bug_10850_84) << "Writing frame data failed.";
+ QUIC_BUG(quic_bug_10850_84) << "Writing frame data failed.";
return false;
}
return true;
@@ -5675,7 +5671,7 @@
}
if (num_ack_blocks_written >= num_ack_blocks) {
if (QUIC_PREDICT_FALSE(num_ack_blocks_written != num_ack_blocks)) {
- QUIC_BUG_V2(quic_bug_10850_85)
+ QUIC_BUG(quic_bug_10850_85)
<< "Wrote " << num_ack_blocks_written << ", expected to write "
<< num_ack_blocks;
}
@@ -5787,7 +5783,7 @@
const uint64_t length_shift = header.packet_number_length * 8;
if (least_unacked_delta >> length_shift > 0) {
- QUIC_BUG_V2(quic_bug_10850_86)
+ QUIC_BUG(quic_bug_10850_86)
<< "packet_number_length " << header.packet_number_length
<< " is too small for least_unacked_delta: " << least_unacked_delta
<< " packet_number:" << header.packet_number
@@ -5801,7 +5797,7 @@
}
if (!AppendPacketNumber(header.packet_number_length,
QuicPacketNumber(least_unacked_delta), writer)) {
- QUIC_BUG_V2(quic_bug_10850_87)
+ QUIC_BUG(quic_bug_10850_87)
<< " seq failed: " << header.packet_number_length;
return false;
}
@@ -5846,7 +5842,7 @@
}
if (frame.packets.Empty() || frame.packets.Max() != largest_acked) {
- QUIC_BUG_V2(quic_bug_10850_88) << "Malformed ack frame: " << frame;
+ QUIC_BUG(quic_bug_10850_88) << "Malformed ack frame: " << frame;
set_detailed_error("Malformed ack frame");
return false;
}
@@ -5893,7 +5889,7 @@
!count_writer.WriteVarInt62(appended_ack_blocks)) {
// This should never happen as ack_block_count is limited by
// max_ack_ranges_.
- QUIC_BUG_V2(quic_bug_10850_89)
+ QUIC_BUG(quic_bug_10850_89)
<< "Ack frame truncation fails. ack_block_count: " << ack_block_count
<< ", appended count: " << appended_ack_blocks;
set_detailed_error("ACK frame truncation fails");
@@ -6008,7 +6004,7 @@
return false;
}
if (frame.num_padding_bytes < 0) {
- QUIC_BUG_IF_V2(quic_bug_12975_9, frame.num_padding_bytes != -1);
+ QUIC_BUG_IF(quic_bug_12975_9, frame.num_padding_bytes != -1);
writer->WritePadding();
return true;
}
@@ -6069,7 +6065,7 @@
QuicDataWriter* writer) {
if (frame.close_type != IETF_QUIC_TRANSPORT_CONNECTION_CLOSE &&
frame.close_type != IETF_QUIC_APPLICATION_CONNECTION_CLOSE) {
- QUIC_BUG_V2(quic_bug_10850_90)
+ QUIC_BUG(quic_bug_10850_90)
<< "Invalid close_type for writing IETF CONNECTION CLOSE.";
set_detailed_error("Invalid close_type for writing IETF CONNECTION CLOSE.");
return false;
@@ -6561,12 +6557,12 @@
void QuicFramer::EnableMultiplePacketNumberSpacesSupport() {
if (supports_multiple_packet_number_spaces_) {
- QUIC_BUG_V2(quic_bug_10850_91)
+ QUIC_BUG(quic_bug_10850_91)
<< "Multiple packet number spaces has already been enabled";
return;
}
if (largest_packet_number_.IsInitialized()) {
- QUIC_BUG_V2(quic_bug_10850_92)
+ QUIC_BUG(quic_bug_10850_92)
<< "Try to enable multiple packet number spaces support after any "
"packet has been received.";
return;
@@ -6858,17 +6854,17 @@
const char* destination_connection_id_bytes,
uint8_t destination_connection_id_length) {
if (packet_bytes == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_93) << "Invalid packet_bytes";
+ QUIC_BUG(quic_bug_10850_93) << "Invalid packet_bytes";
return false;
}
if (packet_length < kMinPacketSizeForVersionNegotiation ||
packet_length > 65535) {
- QUIC_BUG_V2(quic_bug_10850_94) << "Invalid packet_length";
+ QUIC_BUG(quic_bug_10850_94) << "Invalid packet_length";
return false;
}
if (destination_connection_id_length > kQuicMaxConnectionId4BitLength ||
destination_connection_id_length < kQuicDefaultConnectionIdLength) {
- QUIC_BUG_V2(quic_bug_10850_95) << "Invalid connection_id_length";
+ QUIC_BUG(quic_bug_10850_95) << "Invalid connection_id_length";
return false;
}
// clang-format off
@@ -6884,7 +6880,7 @@
static_assert(sizeof(packet_start_bytes) == 5, "bad packet_start_bytes size");
QuicDataWriter writer(packet_length, packet_bytes);
if (!writer.WriteBytes(packet_start_bytes, sizeof(packet_start_bytes))) {
- QUIC_BUG_V2(quic_bug_10850_96) << "Failed to write packet start";
+ QUIC_BUG(quic_bug_10850_96) << "Failed to write packet start";
return false;
}
@@ -6893,7 +6889,7 @@
if (!AppendIetfConnectionIds(
/*version_flag=*/true, /*use_length_prefix=*/true,
destination_connection_id, EmptyQuicConnectionId(), &writer)) {
- QUIC_BUG_V2(quic_bug_10850_97) << "Failed to write connection IDs";
+ QUIC_BUG(quic_bug_10850_97) << "Failed to write connection IDs";
return false;
}
// Add 8 bytes of zeroes followed by 8 bytes of ones to ensure that this does
@@ -6903,14 +6899,14 @@
// valid frame type.
if (!writer.WriteUInt64(0) ||
!writer.WriteUInt64(std::numeric_limits<uint64_t>::max())) {
- QUIC_BUG_V2(quic_bug_10850_98) << "Failed to write 18 bytes";
+ QUIC_BUG(quic_bug_10850_98) << "Failed to write 18 bytes";
return false;
}
// Make sure the polite greeting below is padded to a 16-byte boundary to
// make it easier to read in tcpdump.
while (writer.length() % 16 != 0) {
if (!writer.WriteUInt8(0)) {
- QUIC_BUG_V2(quic_bug_10850_99) << "Failed to write padding byte";
+ QUIC_BUG(quic_bug_10850_99) << "Failed to write padding byte";
return false;
}
}
@@ -6920,7 +6916,7 @@
"Please respond with a Version Negotiation packet indicating what "
"versions you support. Thank you and have a nice day.";
if (!writer.WriteBytes(polite_greeting, sizeof(polite_greeting))) {
- QUIC_BUG_V2(quic_bug_10850_100) << "Failed to write polite greeting";
+ QUIC_BUG(quic_bug_10850_100) << "Failed to write polite greeting";
return false;
}
// Fill the rest of the packet with zeroes.
@@ -6937,7 +6933,7 @@
uint8_t* source_connection_id_length_out,
std::string* detailed_error) {
if (detailed_error == nullptr) {
- QUIC_BUG_V2(quic_bug_10850_101) << "Invalid error_details";
+ QUIC_BUG(quic_bug_10850_101) << "Invalid error_details";
return false;
}
*detailed_error = "";
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index a627213..5217f87 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -153,7 +153,7 @@
return true;
}
bool SetPreliminaryKey(absl::string_view /*key*/) override {
- QUIC_BUG_V2(quic_bug_10486_1) << "should not be called";
+ QUIC_BUG(quic_bug_10486_1) << "should not be called";
return false;
}
bool SetDiversificationNonce(const DiversificationNonce& /*key*/) override {
diff --git a/quic/core/quic_interval_deque.h b/quic/core/quic_interval_deque.h
index 94ce1bd..ba27aa9 100644
--- a/quic/core/quic_interval_deque.h
+++ b/quic/core/quic_interval_deque.h
@@ -162,7 +162,7 @@
// Don't increment when we are at the end.
const std::size_t container_size = deque_->container_.size();
if (index_ >= container_size) {
- QUIC_BUG_V2(quic_bug_10862_1) << "Iterator out of bounds.";
+ QUIC_BUG(quic_bug_10862_1) << "Iterator out of bounds.";
return *this;
}
index_++;
@@ -279,7 +279,7 @@
template <class T, class C>
void QuicIntervalDeque<T, C>::PopFront() {
if (container_.size() == 0) {
- QUIC_BUG_V2(quic_bug_10862_2) << "Trying to pop from an empty container.";
+ QUIC_BUG(quic_bug_10862_2) << "Trying to pop from an empty container.";
return;
}
container_.pop_front();
@@ -362,7 +362,7 @@
QuicInterval<std::size_t> interval = item.interval();
// Adding an empty interval is a bug.
if (interval.Empty()) {
- QUIC_BUG_V2(quic_bug_10862_3)
+ QUIC_BUG(quic_bug_10862_3)
<< "Trying to save empty interval to QuicCircularDeque.";
return;
}
diff --git a/quic/core/quic_legacy_version_encapsulator.cc b/quic/core/quic_legacy_version_encapsulator.cc
index 54880f1..27dbb9b 100644
--- a/quic/core/quic_legacy_version_encapsulator.cc
+++ b/quic/core/quic_legacy_version_encapsulator.cc
@@ -46,13 +46,12 @@
SerializedPacket serialized_packet) {
if (encrypted_length_ != 0) {
unrecoverable_failure_encountered_ = true;
- QUIC_BUG_V2(quic_bug_10615_1) << "OnSerializedPacket called twice";
+ QUIC_BUG(quic_bug_10615_1) << "OnSerializedPacket called twice";
return;
}
if (serialized_packet.encrypted_length == 0) {
unrecoverable_failure_encountered_ = true;
- QUIC_BUG_V2(quic_bug_10615_2)
- << "OnSerializedPacket called with empty packet";
+ QUIC_BUG(quic_bug_10615_2) << "OnSerializedPacket called with empty packet";
return;
}
encrypted_length_ = serialized_packet.encrypted_length;
@@ -62,9 +61,8 @@
QuicErrorCode error,
const std::string& error_details) {
unrecoverable_failure_encountered_ = true;
- QUIC_BUG_V2(quic_bug_10615_3)
- << "QuicLegacyVersionEncapsulator received error " << error << ": "
- << error_details;
+ QUIC_BUG(quic_bug_10615_3) << "QuicLegacyVersionEncapsulator received error "
+ << error << ": " << error_details;
}
bool QuicLegacyVersionEncapsulator::ShouldGeneratePacket(
@@ -122,7 +120,7 @@
outer_creator.SetTransmissionType(NOT_RETRANSMISSION);
if (!outer_creator.AddPaddedSavedFrame(QuicFrame(outer_stream_frame),
NOT_RETRANSMISSION)) {
- QUIC_BUG_V2(quic_bug_10615_4)
+ QUIC_BUG(quic_bug_10615_4)
<< "Failed to add Legacy Version Encapsulation stream frame "
"(max packet length is "
<< outer_creator.max_packet_length() << ") " << outer_stream_frame;
@@ -132,13 +130,13 @@
const QuicPacketLength encrypted_length = creator_delegate.encrypted_length_;
if (creator_delegate.unrecoverable_failure_encountered_ ||
encrypted_length == 0) {
- QUIC_BUG_V2(quic_bug_10615_5)
+ QUIC_BUG(quic_bug_10615_5)
<< "Failed to perform Legacy Version Encapsulation of "
<< inner_packet.length() << " bytes";
return 0;
}
if (encrypted_length > kMaxOutgoingPacketSize) {
- QUIC_BUG_V2(quic_bug_10615_6)
+ QUIC_BUG(quic_bug_10615_6)
<< "Legacy Version Encapsulation outer creator generated a "
"packet with unexpected length "
<< encrypted_length;