Skip to content

Commit

Permalink
Don't clear the readBuffer when sending a RESET_STREAM frame
Browse files Browse the repository at this point in the history
Summary: When we are sending a reset, we shouldn't clear out the read buffer because resets are a unidirectional event.

Reviewed By: hanidamlaj

Differential Revision: D66135577

fbshipit-source-id: ef388954f7c427017a1fa676d67ac80f3d001091
  • Loading branch information
Aman Sharma authored and facebook-github-bot committed Nov 19, 2024
1 parent 6b50bb6 commit 0dca9fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion quic/state/stream/StreamStateFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ void resetQuicStream(QuicStreamState& stream, ApplicationErrorCode error) {
stream.retransmissionBuffer.clear();
stream.writeBuffer.move();
ChainedByteRangeHead(std::move(stream.pendingWrites)); // Will be destructed
stream.readBuffer.clear();
stream.lossBuffer.clear();
stream.streamWriteError = error;
stream.writeBufMeta.length = 0;
Expand Down
2 changes: 1 addition & 1 deletion quic/state/stream/test/StreamStateFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST_F(StreamStateFunctionsTests, BasicResetTest) {
// Something are cleared:
EXPECT_TRUE(stream.writeBuffer.empty());
EXPECT_TRUE(stream.retransmissionBuffer.empty());
EXPECT_TRUE(stream.readBuffer.empty());
EXPECT_FALSE(stream.readBuffer.empty());

// The rest are untouched:
EXPECT_EQ(stream.id, streamId);
Expand Down

0 comments on commit 0dca9fb

Please sign in to comment.