1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Unset stream write callback on reset

Summary: Resetting a stream has the semantics of abandoning all writes on that stream. As such, the application resetting the stream is an implicit signal that it does not care about further writes. It is reasonable then for an application to not expect further write callbacks to trigger.

Reviewed By: lnicco

Differential Revision: D20462859

fbshipit-source-id: b6701e6a262d618c5cd93fd1531095a134f6554e
This commit is contained in:
Matt Joras
2020-03-15 18:52:35 -07:00
committed by Facebook GitHub Bot
parent bea6efc248
commit 694a9bb4cf
2 changed files with 12 additions and 0 deletions

View File

@@ -1451,6 +1451,17 @@ TEST_F(QuicTransportImplTest, TestImmediateClose) {
evb->loopOnce();
}
TEST_F(QuicTransportImplTest, ResetStreamUnsetWriteCallback) {
auto stream = transport->createBidirectionalStream().value();
NiceMock<MockWriteCallback> wcb;
EXPECT_CALL(wcb, onStreamWriteError(stream, _)).Times(0);
transport->notifyPendingWriteOnStream(stream, &wcb);
EXPECT_FALSE(
transport->resetStream(stream, GenericApplicationErrorCode::UNKNOWN)
.hasError());
evb->loopOnce();
}
TEST_F(QuicTransportImplTest, DestroyWithoutClosing) {
EXPECT_CALL(connCallback, onConnectionError(_)).Times(0);
EXPECT_CALL(connCallback, onConnectionEnd()).Times(0);