| Index: net/tools/quic/quic_dispatcher_test.cc
|
| diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
|
| index 6fcc2dba6370927e29788612d0e0ccc96aa60e4c..621890ab5ca50f0189fb93853dc30aad367ca23f 100644
|
| --- a/net/tools/quic/quic_dispatcher_test.cc
|
| +++ b/net/tools/quic/quic_dispatcher_test.cc
|
| @@ -208,11 +208,9 @@ class QuicDispatcherTest : public ::testing::Test {
|
| void ProcessPacket(QuicSocketAddress client_address,
|
| QuicConnectionId connection_id,
|
| bool has_version_flag,
|
| - bool has_multipath_flag,
|
| const string& data) {
|
| - ProcessPacket(client_address, connection_id, has_version_flag,
|
| - has_multipath_flag, data, PACKET_8BYTE_CONNECTION_ID,
|
| - PACKET_6BYTE_PACKET_NUMBER);
|
| + ProcessPacket(client_address, connection_id, has_version_flag, data,
|
| + PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER);
|
| }
|
|
|
| // Process a packet with a default path id, and packet number 1,
|
| @@ -220,20 +218,17 @@ class QuicDispatcherTest : public ::testing::Test {
|
| void ProcessPacket(QuicSocketAddress client_address,
|
| QuicConnectionId connection_id,
|
| bool has_version_flag,
|
| - bool has_multipath_flag,
|
| const string& data,
|
| QuicConnectionIdLength connection_id_length,
|
| QuicPacketNumberLength packet_number_length) {
|
| - ProcessPacket(client_address, connection_id, has_version_flag,
|
| - has_multipath_flag, data, connection_id_length,
|
| - packet_number_length, 1);
|
| + ProcessPacket(client_address, connection_id, has_version_flag, data,
|
| + connection_id_length, packet_number_length, 1);
|
| }
|
|
|
| // Process a packet using the first supported version.
|
| void ProcessPacket(QuicSocketAddress client_address,
|
| QuicConnectionId connection_id,
|
| bool has_version_flag,
|
| - bool has_multipath_flag,
|
| const string& data,
|
| QuicConnectionIdLength connection_id_length,
|
| QuicPacketNumberLength packet_number_length,
|
| @@ -254,7 +249,7 @@ class QuicDispatcherTest : public ::testing::Test {
|
| QuicPacketNumber packet_number) {
|
| QuicVersionVector versions(SupportedVersions(version));
|
| std::unique_ptr<QuicEncryptedPacket> packet(ConstructEncryptedPacket(
|
| - connection_id, has_version_flag, false, false, packet_number, data,
|
| + connection_id, has_version_flag, false, packet_number, data,
|
| connection_id_length, packet_number_length, &versions));
|
| std::unique_ptr<QuicReceivedPacket> received_packet(
|
| ConstructReceivedPacket(*packet, helper_.GetClock()->Now()));
|
| @@ -277,7 +272,8 @@ class QuicDispatcherTest : public ::testing::Test {
|
| const QuicEncryptedPacket& packet) {
|
| EXPECT_EQ(data_connection_map_[conn_id].front().length(),
|
| packet.AsStringPiece().length());
|
| - EXPECT_EQ(data_connection_map_[conn_id].front(), packet.AsStringPiece());
|
| + EXPECT_EQ(data_connection_map_[conn_id].front(),
|
| + packet.AsStringPiece().as_string());
|
| data_connection_map_[conn_id].pop_front();
|
| }
|
|
|
| @@ -348,7 +344,7 @@ TEST_F(QuicDispatcherTest, ProcessPackets) {
|
| ProcessUdpPacket(_, _, _))
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 1))));
|
| - ProcessPacket(client_address, 1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, 1, true, SerializeCHLO());
|
| EXPECT_EQ(client_address, dispatcher_->current_client_address());
|
| EXPECT_EQ(server_address_, dispatcher_->current_server_address());
|
|
|
| @@ -361,14 +357,14 @@ TEST_F(QuicDispatcherTest, ProcessPackets) {
|
| ProcessUdpPacket(_, _, _))
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 2))));
|
| - ProcessPacket(client_address, 2, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, 2, true, SerializeCHLO());
|
|
|
| EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
|
| ProcessUdpPacket(_, _, _))
|
| .Times(1)
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 1))));
|
| - ProcessPacket(client_address, 1, false, false, "data");
|
| + ProcessPacket(client_address, 1, false, "data");
|
| }
|
|
|
| TEST_F(QuicDispatcherTest, StatelessVersionNegotiation) {
|
| @@ -394,7 +390,7 @@ TEST_F(QuicDispatcherTest, Shutdown) {
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 1))));
|
|
|
| - ProcessPacket(client_address, 1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, 1, true, SerializeCHLO());
|
|
|
| EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
|
| CloseConnection(QUIC_PEER_GOING_AWAY, _, _));
|
| @@ -418,7 +414,7 @@ TEST_F(QuicDispatcherTest, TimeWaitListManager) {
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 1))));
|
|
|
| - ProcessPacket(client_address, connection_id, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, connection_id, true, SerializeCHLO());
|
|
|
| // Close the connection by sending public reset packet.
|
| QuicPublicResetPacket packet;
|
| @@ -452,7 +448,7 @@ TEST_F(QuicDispatcherTest, TimeWaitListManager) {
|
| .Times(1);
|
| EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _))
|
| .Times(0);
|
| - ProcessPacket(client_address, connection_id, true, false, "data");
|
| + ProcessPacket(client_address, connection_id, true, "data");
|
| }
|
|
|
| TEST_F(QuicDispatcherTest, NoVersionPacketToTimeWaitListManager) {
|
| @@ -468,7 +464,7 @@ TEST_F(QuicDispatcherTest, NoVersionPacketToTimeWaitListManager) {
|
| .Times(1);
|
| EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _))
|
| .Times(1);
|
| - ProcessPacket(client_address, connection_id, false, false, SerializeCHLO());
|
| + ProcessPacket(client_address, connection_id, false, SerializeCHLO());
|
| }
|
|
|
| TEST_F(QuicDispatcherTest, ProcessPacketWithZeroPort) {
|
| @@ -482,7 +478,7 @@ TEST_F(QuicDispatcherTest, ProcessPacketWithZeroPort) {
|
| EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, _, _, _)).Times(0);
|
| EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _))
|
| .Times(0);
|
| - ProcessPacket(client_address, 1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, 1, true, SerializeCHLO());
|
| }
|
|
|
| TEST_F(QuicDispatcherTest, OKSeqNoPacketProcessed) {
|
| @@ -501,7 +497,7 @@ TEST_F(QuicDispatcherTest, OKSeqNoPacketProcessed) {
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 1))));
|
| // A packet whose packet number is the largest that is allowed to start a
|
| // connection.
|
| - ProcessPacket(client_address, connection_id, true, false, SerializeCHLO(),
|
| + ProcessPacket(client_address, connection_id, true, SerializeCHLO(),
|
| PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
|
| QuicDispatcher::kMaxReasonableInitialPacketNumber);
|
| EXPECT_EQ(client_address, dispatcher_->current_client_address());
|
| @@ -523,7 +519,7 @@ TEST_F(QuicDispatcherTest, TooBigSeqNoPacketToTimeWaitListManager) {
|
| .Times(1);
|
| // A packet whose packet number is one to large to be allowed to start a
|
| // connection.
|
| - ProcessPacket(client_address, connection_id, true, false, SerializeCHLO(),
|
| + ProcessPacket(client_address, connection_id, true, SerializeCHLO(),
|
| PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
|
| QuicDispatcher::kMaxReasonableInitialPacketNumber + 1);
|
| }
|
| @@ -762,7 +758,7 @@ TEST_P(QuicDispatcherStatelessRejectTest, ParameterizedBasicTest) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), connection_id))));
|
| // Process the first packet for the connection.
|
| - ProcessPacket(client_address, connection_id, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, connection_id, true, SerializeCHLO());
|
| if (ExpectStatelessReject()) {
|
| // If this is a stateless reject, the crypto stream will close the
|
| // connection.
|
| @@ -789,7 +785,7 @@ TEST_P(QuicDispatcherStatelessRejectTest, ParameterizedBasicTest) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), connection_id))));
|
| }
|
| - ProcessPacket(client_address, connection_id, true, false, "data");
|
| + ProcessPacket(client_address, connection_id, true, "data");
|
| }
|
|
|
| TEST_P(QuicDispatcherStatelessRejectTest, CheapRejects) {
|
| @@ -822,7 +818,7 @@ TEST_P(QuicDispatcherStatelessRejectTest, CheapRejects) {
|
| {"VER\0", "Q025"}},
|
| kClientHelloMinimumSize);
|
|
|
| - ProcessPacket(client_address, connection_id, true, false,
|
| + ProcessPacket(client_address, connection_id, true,
|
| client_hello.GetSerialized().AsStringPiece().as_string());
|
|
|
| if (GetParam().enable_stateless_rejects_via_flag) {
|
| @@ -838,8 +834,7 @@ TEST_P(QuicDispatcherStatelessRejectTest, BufferNonChlo) {
|
| const QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
|
| const QuicConnectionId connection_id = 1;
|
|
|
| - ProcessPacket(client_address, connection_id, true, false,
|
| - "NOT DATA FOR A CHLO");
|
| + ProcessPacket(client_address, connection_id, true, "NOT DATA FOR A CHLO");
|
|
|
| // Process the first packet for the connection.
|
| CryptoHandshakeMessage client_hello =
|
| @@ -867,7 +862,7 @@ TEST_P(QuicDispatcherStatelessRejectTest, BufferNonChlo) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), connection_id))))
|
| .RetiresOnSaturation();
|
| - ProcessPacket(client_address, connection_id, true, false,
|
| + ProcessPacket(client_address, connection_id, true,
|
| client_hello.GetSerialized().AsStringPiece().as_string());
|
| EXPECT_FALSE(
|
| time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id));
|
| @@ -891,7 +886,7 @@ TEST_F(QuicDispatcherTestStrayPacketConnectionId,
|
| .Times(0);
|
| EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _, _))
|
| .Times(0);
|
| - ProcessPacket(client_address, connection_id, true, false, "data",
|
| + ProcessPacket(client_address, connection_id, true, "data",
|
| PACKET_0BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER);
|
| }
|
|
|
| @@ -935,7 +930,7 @@ class QuicDispatcherWriteBlockedListTest : public QuicDispatcherTest {
|
| ProcessUdpPacket(_, _, _))
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 1))));
|
| - ProcessPacket(client_address, 1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, 1, true, SerializeCHLO());
|
|
|
| EXPECT_CALL(*dispatcher_, CreateQuicSession(_, client_address))
|
| .WillOnce(testing::Return(CreateSession(
|
| @@ -946,7 +941,7 @@ class QuicDispatcherWriteBlockedListTest : public QuicDispatcherTest {
|
| ProcessUdpPacket(_, _, _))
|
| .WillOnce(testing::WithArgs<2>(Invoke(CreateFunctor(
|
| &QuicDispatcherTest::ValidatePacket, base::Unretained(this), 2))));
|
| - ProcessPacket(client_address, 2, true, false, SerializeCHLO());
|
| + ProcessPacket(client_address, 2, true, SerializeCHLO());
|
|
|
| blocked_list_ = QuicDispatcherPeer::GetWriteBlockedList(dispatcher_.get());
|
| }
|
| @@ -1195,7 +1190,7 @@ TEST_P(BufferedPacketStoreTest, ProcessNonChloPacketsUptoLimitAndProcessChlo) {
|
| EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id))
|
| .Times(1);
|
| for (size_t i = 1; i <= kDefaultMaxUndecryptablePackets + 1; ++i) {
|
| - ProcessPacket(client_address, conn_id, true, false,
|
| + ProcessPacket(client_address, conn_id, true,
|
| QuicStrCat("data packet ", i + 1), PACKET_8BYTE_CONNECTION_ID,
|
| PACKET_6BYTE_PACKET_NUMBER, /*packet_number=*/i + 1);
|
| }
|
| @@ -1220,7 +1215,7 @@ TEST_P(BufferedPacketStoreTest, ProcessNonChloPacketsUptoLimitAndProcessChlo) {
|
| .WillRepeatedly(testing::WithArg<2>(
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| - ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
|
| }
|
|
|
| TEST_P(BufferedPacketStoreTest,
|
| @@ -1248,7 +1243,7 @@ TEST_P(BufferedPacketStoreTest,
|
| ShouldCreateOrBufferPacketForConnection(conn_id));
|
| }
|
| }
|
| - ProcessPacket(client_address, conn_id, true, false,
|
| + ProcessPacket(client_address, conn_id, true,
|
| QuicStrCat("data packet on connection ", i),
|
| PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
|
| /*packet_number=*/2);
|
| @@ -1299,7 +1294,7 @@ TEST_P(BufferedPacketStoreTest,
|
| .WillRepeatedly(testing::WithArg<2>(
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| - ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
|
| }
|
| }
|
|
|
| @@ -1313,7 +1308,7 @@ TEST_P(BufferedPacketStoreTest, DeliverEmptyPackets) {
|
| dispatcher_.get(), config_, conn_id, client_address, &mock_helper_,
|
| &mock_alarm_factory_, &crypto_config_,
|
| QuicDispatcherPeer::GetCache(dispatcher_.get()), &session1_)));
|
| - ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
|
| }
|
|
|
| // Tests that a retransmitted CHLO arrives after a connection for the
|
| @@ -1323,9 +1318,9 @@ TEST_P(BufferedPacketStoreTest, ReceiveRetransmittedCHLO) {
|
| QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
|
| server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5);
|
| QuicConnectionId conn_id = 1;
|
| - ProcessPacket(client_address, conn_id, true, false,
|
| - QuicStrCat("data packet ", 2), PACKET_8BYTE_CONNECTION_ID,
|
| - PACKET_6BYTE_PACKET_NUMBER, /*packet_number=*/2);
|
| + ProcessPacket(client_address, conn_id, true, QuicStrCat("data packet ", 2),
|
| + PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
|
| + /*packet_number=*/2);
|
|
|
| // When CHLO arrives, a new session should be created, and all packets
|
| // buffered should be delivered to the session.
|
| @@ -1341,9 +1336,9 @@ TEST_P(BufferedPacketStoreTest, ReceiveRetransmittedCHLO) {
|
| .WillRepeatedly(testing::WithArg<2>(
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| - ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
|
|
|
| - ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
|
| }
|
|
|
| // Tests that expiration of a connection add connection id to time wait list.
|
| @@ -1357,9 +1352,9 @@ TEST_P(BufferedPacketStoreTest, ReceiveCHLOAfterExpiration) {
|
| QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
|
| server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5);
|
| QuicConnectionId conn_id = 1;
|
| - ProcessPacket(client_address, conn_id, true, false,
|
| - QuicStrCat("data packet ", 2), PACKET_8BYTE_CONNECTION_ID,
|
| - PACKET_6BYTE_PACKET_NUMBER, /*packet_number=*/2);
|
| + ProcessPacket(client_address, conn_id, true, QuicStrCat("data packet ", 2),
|
| + PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
|
| + /*packet_number=*/2);
|
|
|
| mock_helper_.AdvanceTime(
|
| QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs));
|
| @@ -1371,7 +1366,7 @@ TEST_P(BufferedPacketStoreTest, ReceiveCHLOAfterExpiration) {
|
| // list.
|
| ASSERT_TRUE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id));
|
| EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, conn_id, _, _));
|
| - ProcessPacket(client_address, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
|
| }
|
|
|
| TEST_P(BufferedPacketStoreTest, ProcessCHLOsUptoLimitAndBufferTheRest) {
|
| @@ -1410,7 +1405,7 @@ TEST_P(BufferedPacketStoreTest, ProcessCHLOsUptoLimitAndBufferTheRest) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| }
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| if (conn_id <= kMaxNumSessionsToCreate + kDefaultMaxConnectionsInStore &&
|
| conn_id > kMaxNumSessionsToCreate) {
|
| EXPECT_TRUE(store->HasChloForConnection(conn_id));
|
| @@ -1469,12 +1464,11 @@ TEST_P(BufferedPacketStoreTest, BufferDuplicatedCHLO) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| }
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| }
|
| // Retransmit CHLO on last connection should be dropped.
|
| QuicConnectionId last_connection = kMaxNumSessionsToCreate + 1;
|
| - ProcessPacket(client_addr_, last_connection, true, false,
|
| - SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, last_connection, true, SerializeFullCHLO());
|
|
|
| size_t packets_buffered = 2;
|
| if (!FLAGS_quic_reloadable_flag_quic_buffer_packets_after_chlo) {
|
| @@ -1516,14 +1510,14 @@ TEST_P(BufferedPacketStoreTest, BufferNonChloPacketsUptoLimitWithChloBuffered) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| }
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| }
|
|
|
| // Process another |kDefaultMaxUndecryptablePackets| + 1 data packets. The
|
| // last one should be dropped.
|
| for (QuicPacketNumber packet_number = 2;
|
| packet_number <= kDefaultMaxUndecryptablePackets + 2; ++packet_number) {
|
| - ProcessPacket(client_addr_, last_connection_id, true, false, "data packet");
|
| + ProcessPacket(client_addr_, last_connection_id, true, "data packet");
|
| }
|
|
|
| // Reset counter and process buffered CHLO.
|
| @@ -1551,7 +1545,7 @@ TEST_P(BufferedPacketStoreTest, ReceiveCHLOForBufferedConnection) {
|
| QuicDispatcherPeer::GetBufferedPackets(dispatcher_.get());
|
|
|
| QuicConnectionId conn_id = 1;
|
| - ProcessPacket(client_addr_, conn_id, true, false, "data packet",
|
| + ProcessPacket(client_addr_, conn_id, true, "data packet",
|
| PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
|
| /*packet_number=*/1);
|
| // Fill packet buffer to full with CHLOs on other connections. Need to feed
|
| @@ -1573,13 +1567,12 @@ TEST_P(BufferedPacketStoreTest, ReceiveCHLOForBufferedConnection) {
|
| Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
|
| base::Unretained(this), conn_id))));
|
| }
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| }
|
| EXPECT_FALSE(store->HasChloForConnection(/*connection_id=*/1));
|
|
|
| // CHLO on connection 1 should still be buffered.
|
| - ProcessPacket(client_addr_, /*connection_id=*/1, true, false,
|
| - SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, /*connection_id=*/1, true, SerializeFullCHLO());
|
| EXPECT_TRUE(store->HasChloForConnection(/*connection_id=*/1));
|
| }
|
|
|
| @@ -1702,7 +1695,7 @@ TEST_F(AsyncGetProofTest, BasicAccept) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will accept.
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
|
|
| check.Call(1);
|
| @@ -1713,7 +1706,7 @@ TEST_F(AsyncGetProofTest, BasicAccept) {
|
|
|
| check.Call(2);
|
| // Verify that a data packet gets processed immediately.
|
| - ProcessPacket(client_addr_, conn_id, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id, true, "My name is Data");
|
| }
|
|
|
| // Test a simple situation of connections which the StatelessRejector will
|
| @@ -1740,7 +1733,7 @@ TEST_F(AsyncGetProofTest, BasicReject) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will reject.
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
|
|
| // Complete the ProofSource::GetProof call and verify that the connection and
|
| @@ -1751,7 +1744,7 @@ TEST_F(AsyncGetProofTest, BasicReject) {
|
|
|
| // Verify that a data packet is passed to the time wait list manager.
|
| check.Call(2);
|
| - ProcessPacket(client_addr_, conn_id, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id, true, "My name is Data");
|
| }
|
|
|
| // Test a situation with multiple interleaved connections which the
|
| @@ -1801,11 +1794,11 @@ TEST_F(AsyncGetProofTest, MultipleAccept) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will accept.
|
| - ProcessPacket(client_addr_, conn_id_1, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id_1, true, SerializeFullCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
|
|
| // Send another CHLO that the StatelessRejector will accept.
|
| - ProcessPacket(client_addr_, conn_id_2, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id_2, true, SerializeFullCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 2);
|
|
|
| // Complete the second ProofSource::GetProof call and verify that a session is
|
| @@ -1816,12 +1809,12 @@ TEST_F(AsyncGetProofTest, MultipleAccept) {
|
|
|
| // Verify that a data packet on that connection gets processed immediately.
|
| check.Call(2);
|
| - ProcessPacket(client_addr_, conn_id_2, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id_2, true, "My name is Data");
|
|
|
| // Verify that a data packet on the other connection does not get processed
|
| // yet.
|
| check.Call(3);
|
| - ProcessPacket(client_addr_, conn_id_1, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id_1, true, "My name is Data");
|
| EXPECT_TRUE(store->HasBufferedPackets(conn_id_1));
|
| EXPECT_FALSE(store->HasBufferedPackets(conn_id_2));
|
|
|
| @@ -1870,11 +1863,11 @@ TEST_F(AsyncGetProofTest, MultipleReject) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will reject.
|
| - ProcessPacket(client_addr_, conn_id_1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_addr_, conn_id_1, true, SerializeCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
|
|
| // Send another CHLO that the StatelessRejector will reject.
|
| - ProcessPacket(client_addr_, conn_id_2, true, false, SerializeCHLO());
|
| + ProcessPacket(client_addr_, conn_id_2, true, SerializeCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 2);
|
|
|
| // Complete the second ProofSource::GetProof call and verify that the
|
| @@ -1886,11 +1879,11 @@ TEST_F(AsyncGetProofTest, MultipleReject) {
|
| // Verify that a data packet on that connection gets processed immediately by
|
| // the time wait manager.
|
| check.Call(2);
|
| - ProcessPacket(client_addr_, conn_id_2, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id_2, true, "My name is Data");
|
|
|
| // Verify that a data packet on the first connection gets buffered.
|
| check.Call(3);
|
| - ProcessPacket(client_addr_, conn_id_1, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id_1, true, "My name is Data");
|
| EXPECT_TRUE(store->HasBufferedPackets(conn_id_1));
|
| EXPECT_FALSE(store->HasBufferedPackets(conn_id_2));
|
|
|
| @@ -1929,13 +1922,13 @@ TEST_F(AsyncGetProofTest, MultipleIdenticalReject) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will reject.
|
| - ProcessPacket(client_addr_, conn_id_1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_addr_, conn_id_1, true, SerializeCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
| EXPECT_FALSE(store->HasBufferedPackets(conn_id_1));
|
|
|
| // Send an identical CHLO which should get buffered.
|
| check.Call(1);
|
| - ProcessPacket(client_addr_, conn_id_1, true, false, SerializeCHLO());
|
| + ProcessPacket(client_addr_, conn_id_1, true, SerializeCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
| EXPECT_TRUE(store->HasBufferedPackets(conn_id_1));
|
|
|
| @@ -1971,13 +1964,13 @@ TEST_F(AsyncGetProofTest, BufferTimeout) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will accept.
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
| EXPECT_FALSE(store->HasBufferedPackets(conn_id));
|
|
|
| // Send a data packet that will get buffered
|
| check.Call(1);
|
| - ProcessPacket(client_addr_, conn_id, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id, true, "My name is Data");
|
| EXPECT_TRUE(store->HasBufferedPackets(conn_id));
|
|
|
| // Pretend that enough time has gone by for the packets to get expired out of
|
| @@ -2029,13 +2022,13 @@ TEST_F(AsyncGetProofTest, TimeWaitTimeout) {
|
| }
|
|
|
| // Send a CHLO that the StatelessRejector will accept.
|
| - ProcessPacket(client_addr_, conn_id, true, false, SerializeFullCHLO());
|
| + ProcessPacket(client_addr_, conn_id, true, SerializeFullCHLO());
|
| ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1);
|
| EXPECT_FALSE(store->HasBufferedPackets(conn_id));
|
|
|
| // Send a data packet that will get buffered
|
| check.Call(1);
|
| - ProcessPacket(client_addr_, conn_id, true, false, "My name is Data");
|
| + ProcessPacket(client_addr_, conn_id, true, "My name is Data");
|
| EXPECT_TRUE(store->HasBufferedPackets(conn_id));
|
|
|
| // Pretend that enough time has gone by for the packets to get expired out of
|
|
|