mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-24 04:01:07 +03:00
Keep track of the minimum reliable size ACKed
Summary: With normal resets, we transition from `StreamSendState::ResetSent` to `StreamSendState::Closed` when we get an ACK for a RESET_STREAM frame. With reliable resets, this is going to be a little more complicated. We can't automatically transition from `StreamSendState::ResetSent` to `StreamSendState::Closed` when we get an ACK for a RESET_STREAM_AT frame because it's possible that the peer hasn't yet received all data until the reliable reset offset. My idea is the following: Keep track of the `minReliableSizeAcked`, which is the lowest value of the reliable size in any RESET_STREAM_AT frame that was ACKed by the peer. We set it to 0 if a RESET_STREAM frame was ACKed by the peer. Then, we can transition from `StreamSendState::ResetSent` to `StreamSendState::Closed` if any one of the following two events happen: * We get an ACK for a RESET_STREAM_AT or a RESET_STREAM frame, and all data until the `minReliableSizeAcked` has been ACKed by the peer. * We get an ACK for stream data, and this puts us in a state where all data until the `minReliableSizeAcked` has been ACKed by the peer. Note: This diff doesn't have any functional change. The only change is that we're keeping track of the `minReliableSizeAcked`, but aren't using it anywhere. Reviewed By: mjoras Differential Revision: D66781199 fbshipit-source-id: 2aa5138a18f70e9801e59e747460558ba706939c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1695ecc575
commit
fca90d483b
@@ -1059,7 +1059,7 @@ TEST_F(QuicStateFunctionsTest, TestInvokeStreamStateMachineStreamError) {
|
||||
QuicStreamState stream(1, conn);
|
||||
RstStreamFrame rst(1, GenericApplicationErrorCode::UNKNOWN, 100);
|
||||
try {
|
||||
sendRstAckSMHandler(stream);
|
||||
sendRstAckSMHandler(stream, folly::none);
|
||||
ADD_FAILURE();
|
||||
} catch (QuicTransportException& ex) {
|
||||
EXPECT_EQ(ex.errorCode(), TransportErrorCode::STREAM_STATE_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user