Removes a detailed error message that is propagated as a std::string and only referenced in gQUIC, which is deprecated. Protected by removes unused error details, not protected. PiperOrigin-RevId: 596092468
diff --git a/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.cc index 8cf2e14..ab6128e 100644 --- a/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.cc +++ b/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -55,7 +55,7 @@ QUICHE_DVLOG(1) << "Name length (" << len << ") is longer than permitted (" << max_string_size_bytes_ << ")"; - ReportError(HpackDecodingError::kNameTooLong, ""); + ReportError(HpackDecodingError::kNameTooLong); QUICHE_CODE_COUNT_N(decompress_failure_3, 18, 23); return; } @@ -70,7 +70,7 @@ absl::string_view(data, len)); QUICHE_DCHECK_EQ(maybe_name_index_, 0u); if (!error_detected_ && !name_.OnData(data, len)) { - ReportError(HpackDecodingError::kNameHuffmanError, ""); + ReportError(HpackDecodingError::kNameHuffmanError); QUICHE_CODE_COUNT_N(decompress_failure_3, 19, 23); } } @@ -79,7 +79,7 @@ QUICHE_DVLOG(2) << "HpackWholeEntryBuffer::OnNameEnd"; QUICHE_DCHECK_EQ(maybe_name_index_, 0u); if (!error_detected_ && !name_.OnEnd()) { - ReportError(HpackDecodingError::kNameHuffmanError, ""); + ReportError(HpackDecodingError::kNameHuffmanError); QUICHE_CODE_COUNT_N(decompress_failure_3, 20, 23); } } @@ -89,11 +89,12 @@ << (huffman_encoded ? "true" : "false") << ", len=" << len; if (!error_detected_) { if (len > max_string_size_bytes_) { - std::string detailed_error = absl::StrCat( - "Value length (", len, ") of [", name_.GetStringIfComplete(), - "] is longer than permitted (", max_string_size_bytes_, ")"); - QUICHE_DVLOG(1) << detailed_error; - ReportError(HpackDecodingError::kValueTooLong, detailed_error); + QUICHE_DVLOG(1) << "Value length (" << len << ") of [" + << name_.GetStringIfComplete() + << "] is longer than permitted (" + << max_string_size_bytes_ << ")"; + + ReportError(HpackDecodingError::kValueTooLong); QUICHE_CODE_COUNT_N(decompress_failure_3, 21, 23); return; } @@ -107,7 +108,7 @@ << quiche::QuicheTextUtils::HexDump( absl::string_view(data, len)); if (!error_detected_ && !value_.OnData(data, len)) { - ReportError(HpackDecodingError::kValueHuffmanError, ""); + ReportError(HpackDecodingError::kValueHuffmanError); QUICHE_CODE_COUNT_N(decompress_failure_3, 22, 23); } } @@ -118,7 +119,7 @@ return; } if (!value_.OnEnd()) { - ReportError(HpackDecodingError::kValueHuffmanError, ""); + ReportError(HpackDecodingError::kValueHuffmanError); QUICHE_CODE_COUNT_N(decompress_failure_3, 23, 23); return; } @@ -138,13 +139,12 @@ listener_->OnDynamicTableSizeUpdate(size); } -void HpackWholeEntryBuffer::ReportError(HpackDecodingError error, - std::string detailed_error) { +void HpackWholeEntryBuffer::ReportError(HpackDecodingError error) { if (!error_detected_) { QUICHE_DVLOG(1) << "HpackWholeEntryBuffer::ReportError: " << HpackDecodingErrorToString(error); error_detected_ = true; - listener_->OnHpackDecodeError(error, detailed_error); + listener_->OnHpackDecodeError(error, ""); listener_ = HpackWholeEntryNoOpListener::NoOpListener(); } }
diff --git a/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.h b/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.h index b7bd108..f06ae16 100644 --- a/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.h +++ b/quiche/http2/hpack/decoder/hpack_whole_entry_buffer.h
@@ -76,7 +76,7 @@ void OnDynamicTableSizeUpdate(size_t size) override; private: - void ReportError(HpackDecodingError error, std::string detailed_error); + void ReportError(HpackDecodingError error); HpackWholeEntryListener* listener_; HpackDecoderStringBuffer name_, value_;
diff --git a/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc b/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc index d2bb81c..03ad77c 100644 --- a/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc +++ b/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
@@ -164,9 +164,7 @@ TEST_F(HpackWholeEntryBufferTest, ValueTooLong) { entry_buffer_.OnStartLiteralHeader(HpackEntryType::kIndexedLiteralHeader, 0); EXPECT_CALL(listener_, - OnHpackDecodeError( - HpackDecodingError::kValueTooLong, - "Value length (21) of [path] is longer than permitted (20)")); + OnHpackDecodeError(HpackDecodingError::kValueTooLong, "")); entry_buffer_.OnNameStart(false, 4); entry_buffer_.OnNameData("path", 4); entry_buffer_.OnNameEnd(); @@ -177,9 +175,7 @@ TEST_F(HpackWholeEntryBufferTest, ValueTooLongWithoutName) { entry_buffer_.OnStartLiteralHeader(HpackEntryType::kIndexedLiteralHeader, 1); EXPECT_CALL(listener_, - OnHpackDecodeError( - HpackDecodingError::kValueTooLong, - "Value length (21) of [] is longer than permitted (20)")); + OnHpackDecodeError(HpackDecodingError::kValueTooLong, "")); entry_buffer_.OnValueStart(false, kMaxStringSize + 1); }