Fix QUICHE build issue in Chromium.
PiperOrigin-RevId: 341714423
Change-Id: I675ed0a9af80de91e4481dcaa792e7ddbb947421
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc
index a648c69..6b188fc 100644
--- a/quic/core/http/end_to_end_test.cc
+++ b/quic/core/http/end_to_end_test.cc
@@ -2389,8 +2389,7 @@
const QuicPacketCount packets_sent_now =
client_connection->GetStats().packets_sent;
- if (version_.UsesHttp3() &&
- absl::GetFlag(FLAGS_gfe2_reloadable_flag_quic_split_up_send_rst_2)) {
+ if (version_.UsesHttp3() && GetQuicReloadableFlag(quic_split_up_send_rst_2)) {
// Make sure 2 packets were sent, one for QPACK instructions, another for
// RESET_STREAM and STOP_SENDING.
EXPECT_EQ(packets_sent_before + 2, packets_sent_now);
diff --git a/quic/core/quic_stream_sequencer_buffer.cc b/quic/core/quic_stream_sequencer_buffer.cc
index 9208de6..c4559dc 100644
--- a/quic/core/quic_stream_sequencer_buffer.cc
+++ b/quic/core/quic_stream_sequencer_buffer.cc
@@ -92,16 +92,16 @@
if (current_blocks_count_ >= num_of_blocks_needed) {
return;
}
- size_t new_block_count_ =
- std::clamp(kBlocksGrowthFactor * current_blocks_count_,
- num_of_blocks_needed, max_blocks_count_);
- auto new_blocks = std::make_unique<BufferBlock*[]>(new_block_count_);
+ size_t new_block_count = kBlocksGrowthFactor * current_blocks_count_;
+ new_block_count = std::min(std::max(new_block_count, num_of_blocks_needed),
+ max_blocks_count_);
+ auto new_blocks = std::make_unique<BufferBlock*[]>(new_block_count);
if (blocks_ != nullptr) {
memcpy(new_blocks.get(), blocks_.get(),
current_blocks_count_ * sizeof(BufferBlock*));
}
blocks_ = std::move(new_blocks);
- current_blocks_count_ = new_block_count_;
+ current_blocks_count_ = new_block_count;
}
QuicErrorCode QuicStreamSequencerBuffer::OnStreamData(