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

Log Server Handshake Size

Summary: - logging number of bytes the server sent during the handshake for insight.

Reviewed By: mjoras

Differential Revision: D33069800

fbshipit-source-id: e7e8f25183ee30de99e2971bae3c6b93882f6e63
This commit is contained in:
Hani Damlaj
2022-01-06 10:32:50 -08:00
committed by Facebook GitHub Bot
parent 0a4790b993
commit f60c254c49
5 changed files with 125 additions and 97 deletions

View File

@@ -3149,6 +3149,7 @@ TEST_F(QuicTransportFunctionsTest, TestCryptoWritingIsHandshakeInOutstanding) {
EXPECT_EQ(1, res.packetsWritten);
EXPECT_EQ(0, res.probesWritten);
EXPECT_GE(res.bytesWritten, buf->computeChainDataLength());
ASSERT_EQ(1, conn->outstandings.packets.size());
EXPECT_TRUE(getFirstOutstandingPacket(*conn, PacketNumberSpace::Initial)
->metadata.isHandshake);
@@ -3173,6 +3174,7 @@ TEST_F(QuicTransportFunctionsTest, NoCryptoProbeWriteIfNoProbeCredit) {
*conn->initialHeaderCipher,
getVersion(*conn),
conn->transportSettings.writeConnectionDataPacketsLimit);
EXPECT_GE(res.bytesWritten, buf->computeChainDataLength());
EXPECT_EQ(1, res.packetsWritten);
EXPECT_EQ(0, res.probesWritten);
@@ -3195,7 +3197,7 @@ TEST_F(QuicTransportFunctionsTest, NoCryptoProbeWriteIfNoProbeCredit) {
*conn->initialHeaderCipher,
getVersion(*conn),
conn->transportSettings.writeConnectionDataPacketsLimit);
EXPECT_EQ(0, res.bytesWritten);
EXPECT_EQ(0, res.packetsWritten);
EXPECT_EQ(0, res.probesWritten);
}
@@ -3208,7 +3210,7 @@ TEST_F(QuicTransportFunctionsTest, ResetNumProbePackets) {
auto rawSocket = socket.get();
conn->pendingEvents.numProbePackets[PacketNumberSpace::Initial] = 2;
writeCryptoAndAckDataToSocket(
auto writeRes1 = writeCryptoAndAckDataToSocket(
*rawSocket,
*conn,
*conn->clientConnectionId,
@@ -3219,11 +3221,12 @@ TEST_F(QuicTransportFunctionsTest, ResetNumProbePackets) {
getVersion(*conn),
conn->transportSettings.writeConnectionDataPacketsLimit);
EXPECT_FALSE(conn->pendingEvents.anyProbePackets());
EXPECT_EQ(0, writeRes1.bytesWritten);
conn->handshakeWriteCipher = createNoOpAead();
conn->handshakeWriteHeaderCipher = createNoOpHeaderCipher();
conn->pendingEvents.numProbePackets[PacketNumberSpace::Handshake] = 2;
writeCryptoAndAckDataToSocket(
auto writeRes2 = writeCryptoAndAckDataToSocket(
*rawSocket,
*conn,
*conn->clientConnectionId,
@@ -3234,6 +3237,7 @@ TEST_F(QuicTransportFunctionsTest, ResetNumProbePackets) {
getVersion(*conn),
conn->transportSettings.writeConnectionDataPacketsLimit);
EXPECT_FALSE(conn->pendingEvents.anyProbePackets());
EXPECT_EQ(0, writeRes2.bytesWritten);
conn->oneRttWriteCipher = createNoOpAead();
conn->oneRttWriteHeaderCipher = createNoOpHeaderCipher();