mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-08 09:42:06 +03:00
onStreamPreReaped
Summary: Move the callback to before the stream is destroyed. Reviewed By: jbeshay Differential Revision: D52127833 fbshipit-source-id: 1a9dbcf9ad92dbdb4e15409a418307dc6852b091
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9285422f2a
commit
f7a59e8465
@@ -132,10 +132,11 @@ class QuicSocket {
|
|||||||
StreamGroupId) noexcept {}
|
StreamGroupId) noexcept {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when a given stream has been closed and its state reaped by
|
* Invoked when a given stream has been closed and its state is about to
|
||||||
* the transport. After this point no operations can be done on the stream.
|
* be reaped by the transport. This is the last chance to do any final
|
||||||
|
* state querying operations on the stream.
|
||||||
*/
|
*/
|
||||||
virtual void onStreamStateReaped(StreamId) noexcept {}
|
virtual void onStreamPreReaped(StreamId) noexcept {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when a stream receives a StopSending frame from a peer.
|
* Invoked when a stream receives a StopSending frame from a peer.
|
||||||
|
@@ -2610,10 +2610,10 @@ void QuicTransportBase::checkForClosedStream() {
|
|||||||
conn_->qLogger->addTransportStateUpdate(
|
conn_->qLogger->addTransportStateUpdate(
|
||||||
getClosingStream(folly::to<std::string>(*itr)));
|
getClosingStream(folly::to<std::string>(*itr)));
|
||||||
}
|
}
|
||||||
conn_->streamManager->removeClosedStream(*itr);
|
|
||||||
if (connCallback_) {
|
if (connCallback_) {
|
||||||
connCallback_->onStreamStateReaped(*itr);
|
connCallback_->onStreamPreReaped(*itr);
|
||||||
}
|
}
|
||||||
|
conn_->streamManager->removeClosedStream(*itr);
|
||||||
maybeSendStreamLimitUpdates(*conn_);
|
maybeSendStreamLimitUpdates(*conn_);
|
||||||
if (readCbIt != readCallbacks_.end()) {
|
if (readCbIt != readCallbacks_.end()) {
|
||||||
readCallbacks_.erase(readCbIt);
|
readCallbacks_.erase(readCbIt);
|
||||||
|
@@ -123,7 +123,7 @@ class MockConnectionCallback : public QuicSocket::ConnectionCallback {
|
|||||||
onNewUnidirectionalStreamInGroup,
|
onNewUnidirectionalStreamInGroup,
|
||||||
(StreamId, StreamGroupId),
|
(StreamId, StreamGroupId),
|
||||||
(noexcept));
|
(noexcept));
|
||||||
MOCK_METHOD((void), onStreamStateReaped, (StreamId), (noexcept));
|
MOCK_METHOD((void), onStreamPreReaped, (StreamId), (noexcept));
|
||||||
MOCK_METHOD(
|
MOCK_METHOD(
|
||||||
(void),
|
(void),
|
||||||
onStopSending,
|
onStopSending,
|
||||||
|
@@ -1743,7 +1743,7 @@ TEST_P(QuicTransportImplTestBase, CloseStreamAfterReadError) {
|
|||||||
transport->closeStream(stream1);
|
transport->closeStream(stream1);
|
||||||
|
|
||||||
EXPECT_CALL(readCb1, readError(stream1, IsError(LocalErrorCode::NO_ERROR)));
|
EXPECT_CALL(readCb1, readError(stream1, IsError(LocalErrorCode::NO_ERROR)));
|
||||||
EXPECT_CALL(connCallback, onStreamStateReaped(stream1));
|
EXPECT_CALL(connCallback, onStreamPreReaped(stream1));
|
||||||
transport->driveReadCallbacks();
|
transport->driveReadCallbacks();
|
||||||
|
|
||||||
EXPECT_FALSE(transport->transportConn->streamManager->streamExists(stream1));
|
EXPECT_FALSE(transport->transportConn->streamManager->streamExists(stream1));
|
||||||
|
Reference in New Issue
Block a user