mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-08 09:42:06 +03:00
Back out "Revert D15267963: [quic] Clone RetireConnectionIdFrame"
Summary: Original commit changeset: c9fb0a514788 Reviewed By: lnicco Differential Revision: D17688756 fbshipit-source-id: fc098fa9804bf0076cb8f2ff0c6d6b8550021a34
This commit is contained in:
committed by
Facebook Github Bot
parent
7682c12bf5
commit
8af79b3436
@@ -1510,6 +1510,69 @@ TEST_F(QuicTransportTest, SendRetireConnectionIdFrame) {
|
|||||||
EXPECT_TRUE(foundRetireConnectionId);
|
EXPECT_TRUE(foundRetireConnectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(QuicTransportTest, CloneRetireConnectionIdFrame) {
|
||||||
|
auto& conn = transport_->getConnectionState();
|
||||||
|
// knock every handshake outstanding packets out
|
||||||
|
conn.outstandingHandshakePacketsCount = 0;
|
||||||
|
conn.outstandingPureAckPacketsCount = 0;
|
||||||
|
conn.outstandingPackets.clear();
|
||||||
|
conn.lossState.initialLossTime.clear();
|
||||||
|
conn.lossState.handshakeLossTime.clear();
|
||||||
|
conn.lossState.appDataLossTime.clear();
|
||||||
|
|
||||||
|
RetireConnectionIdFrame retireConnId(1);
|
||||||
|
sendSimpleFrame(conn, retireConnId);
|
||||||
|
transport_->updateWriteLooper(true);
|
||||||
|
loopForWrites();
|
||||||
|
|
||||||
|
EXPECT_EQ(conn.outstandingPackets.size(), 1);
|
||||||
|
auto numRetireConnIdPackets = std::count_if(
|
||||||
|
conn.outstandingPackets.begin(),
|
||||||
|
conn.outstandingPackets.end(),
|
||||||
|
[&](auto& p) {
|
||||||
|
return std::find_if(
|
||||||
|
p.packet.frames.begin(),
|
||||||
|
p.packet.frames.end(),
|
||||||
|
[&](auto& f) {
|
||||||
|
return folly::variant_match(
|
||||||
|
f,
|
||||||
|
[&](QuicSimpleFrame& s) {
|
||||||
|
return folly::variant_match(
|
||||||
|
s,
|
||||||
|
[&](RetireConnectionIdFrame&) { return true; },
|
||||||
|
[&](auto&) { return false; });
|
||||||
|
},
|
||||||
|
[&](auto&) { return false; });
|
||||||
|
}) != p.packet.frames.end();
|
||||||
|
});
|
||||||
|
EXPECT_EQ(numRetireConnIdPackets, 1);
|
||||||
|
|
||||||
|
// Force a timeout with no data so that it clones the packet
|
||||||
|
transport_->lossTimeout().timeoutExpired();
|
||||||
|
// On PTO, endpoint sends 2 probing packets, thus 1+2=3
|
||||||
|
EXPECT_EQ(conn.outstandingPackets.size(), 3);
|
||||||
|
numRetireConnIdPackets = std::count_if(
|
||||||
|
conn.outstandingPackets.begin(),
|
||||||
|
conn.outstandingPackets.end(),
|
||||||
|
[&](auto& p) {
|
||||||
|
return std::find_if(
|
||||||
|
p.packet.frames.begin(),
|
||||||
|
p.packet.frames.end(),
|
||||||
|
[&](auto& f) {
|
||||||
|
return folly::variant_match(
|
||||||
|
f,
|
||||||
|
[&](QuicSimpleFrame& s) {
|
||||||
|
return folly::variant_match(
|
||||||
|
s,
|
||||||
|
[&](RetireConnectionIdFrame&) { return true; },
|
||||||
|
[&](auto&) { return false; });
|
||||||
|
},
|
||||||
|
[&](auto&) { return false; });
|
||||||
|
}) != p.packet.frames.end();
|
||||||
|
});
|
||||||
|
EXPECT_EQ(numRetireConnIdPackets, 3);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(QuicTransportTest, NonWritableStreamAPI) {
|
TEST_F(QuicTransportTest, NonWritableStreamAPI) {
|
||||||
auto streamId = transport_->createBidirectionalStream().value();
|
auto streamId = transport_->createBidirectionalStream().value();
|
||||||
auto buf = buildRandomInputData(20);
|
auto buf = buildRandomInputData(20);
|
||||||
|
@@ -69,7 +69,7 @@ folly::Optional<QuicSimpleFrame> updateSimpleFrameOnPacketClone(
|
|||||||
},
|
},
|
||||||
[&](const RetireConnectionIdFrame&) -> folly::Optional<QuicSimpleFrame> {
|
[&](const RetireConnectionIdFrame&) -> folly::Optional<QuicSimpleFrame> {
|
||||||
// TODO junqiw
|
// TODO junqiw
|
||||||
return folly::none;
|
return QuicSimpleFrame(frame);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user