diff --git a/daemon/mgmt/tables-config-section.hpp b/daemon/mgmt/tables-config-section.hpp index d1ac1d49..932df2c1 100644 --- a/daemon/mgmt/tables-config-section.hpp +++ b/daemon/mgmt/tables-config-section.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/** - * Copyright (c) 2014-2016, Regents of the University of California, +/* + * Copyright (c) 2014-2018, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & Marie Curie, Sorbonne University, @@ -38,7 +38,7 @@ namespace nfd { * tables * { * cs_max_packets 65536 - * cs_policy priority_fifo + * cs_policy lru * cs_unsolicited_policy drop-all * * strategy_choice diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp index 1663d8fe..85ef3885 100644 --- a/daemon/table/cs.cpp +++ b/daemon/table/cs.cpp @@ -37,11 +37,10 @@ NDN_CXX_ASSERT_FORWARD_ITERATOR(Cs::const_iterator); NFD_LOG_INIT(ContentStore); -unique_ptr +static unique_ptr makeDefaultPolicy() { - const std::string DEFAULT_POLICY = "priority_fifo"; - return Policy::create(DEFAULT_POLICY); + return Policy::create("lru"); } Cs::Cs(size_t nMaxPackets) diff --git a/nfd.conf.sample.in b/nfd.conf.sample.in index 8efc2abf..c015eb0a 100644 --- a/nfd.conf.sample.in +++ b/nfd.conf.sample.in @@ -51,7 +51,7 @@ tables ; Set the CS replacement policy. ; Available policies are: priority_fifo, lru - cs_policy priority_fifo + cs_policy lru ; Set a policy to decide whether to cache or drop unsolicited Data. ; Available policies are: drop-all, admit-local, admit-network, admit-all diff --git a/tests/daemon/mgmt/tables-config-section.t.cpp b/tests/daemon/mgmt/tables-config-section.t.cpp index 32aab404..a52b688f 100644 --- a/tests/daemon/mgmt/tables-config-section.t.cpp +++ b/tests/daemon/mgmt/tables-config-section.t.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/** - * Copyright (c) 2014-2016, Regents of the University of California, +/* + * Copyright (c) 2014-2018, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & Marie Curie, Sorbonne University, @@ -162,9 +162,9 @@ BOOST_AUTO_TEST_CASE(Default) } )CONFIG"; - BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false)); + runConfig(CONFIG, false); cs::Policy* currentPolicy = cs.getPolicy(); - NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::PriorityFifoPolicy); + NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::LruPolicy); } BOOST_AUTO_TEST_CASE(Known) @@ -172,17 +172,17 @@ BOOST_AUTO_TEST_CASE(Known) const std::string CONFIG = R"CONFIG( tables { - cs_policy lru + cs_policy priority_fifo } )CONFIG"; - BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true)); + runConfig(CONFIG, true); cs::Policy* currentPolicy = cs.getPolicy(); - NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::PriorityFifoPolicy); - - BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false)); - currentPolicy = cs.getPolicy(); NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::LruPolicy); + + runConfig(CONFIG, false); + currentPolicy = cs.getPolicy(); + NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::PriorityFifoPolicy); } BOOST_AUTO_TEST_CASE(Unknown)