build: Fix compilation errors and deprecation warnings
Change-Id: Ibbe2d30ced038f0c46a8669b5957b68c4f265350
This commit is contained in:
1 parent
7c97cfa743
commit
7fe59830f4
6 files changed
+28
-21
No files matched your search
@@ -32,8 +32,8 @@ SyncInterestTable::SyncInterestTable (boost::asio::io_service& io, ndn::time::sy
|
||||
: m_entryLifetime (lifetime)
|
||||
, m_scheduler(io)
|
||||
{
|
||||
m_scheduler.schedulePeriodicEvent (ndn::time::seconds (4), ndn::time::seconds (4),
|
||||
ndn::bind(&SyncInterestTable::expireInterests, this));
|
||||
m_scheduler.scheduleEvent(ndn::time::seconds (4),
|
||||
ndn::bind(&SyncInterestTable::expireInterests, this));
|
||||
}
|
||||
|
||||
SyncInterestTable::~SyncInterestTable ()
|
||||
@@ -116,6 +116,9 @@ void SyncInterestTable::expireInterests ()
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
m_scheduler.scheduleEvent(ndn::time::seconds (4),
|
||||
ndn::bind(&SyncInterestTable::expireInterests, this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ IntroCertificate::IntroCertificate(const ndn::Data& data)
|
||||
// Naming convention /<sync_prefix>/CHRONOS-INTRO-CERT/introducee_certname/introducer_certname/version
|
||||
ndn::Name dataName = data.getName();
|
||||
|
||||
if(dataName.size() < 4 || dataName.get(-4).toEscapedString() != "CHRONOS-INTRO-CERT")
|
||||
if(dataName.size() < 4 || dataName.get(-4).toUri() != "CHRONOS-INTRO-CERT")
|
||||
throw Error("Not a Sync::IntroCertificate");
|
||||
|
||||
try
|
||||
|
||||
+5
-5
@@ -49,7 +49,7 @@ SyncSocket::SyncSocket (const Name& syncPrefix,
|
||||
, m_newDataCallback(dataCallback)
|
||||
, m_myCertificate(myCertificate)
|
||||
, m_face(face)
|
||||
, m_ioService(face->ioService())
|
||||
, m_ioService(face->getIoService())
|
||||
{
|
||||
if(withRoutingPrefix && !routingPrefix.isPrefixOf(m_dataPrefix))
|
||||
{
|
||||
@@ -93,8 +93,8 @@ SyncSocket::publishData(const uint8_t* buf, size_t len, int freshness, bool isCe
|
||||
data->setContent(reinterpret_cast<const uint8_t*>(buf), len);
|
||||
data->setFreshnessPeriod(time::milliseconds(1000*freshness));
|
||||
|
||||
m_ioService->post(bind(&SyncSocket::publishDataInternal, this,
|
||||
data, isCert));
|
||||
m_ioService.post(bind(&SyncSocket::publishDataInternal, this,
|
||||
data, isCert));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -164,7 +164,7 @@ SyncSocket::onData(const ndn::Interest& interest, Data& data, const OnDataValida
|
||||
for(; it != end; it++)
|
||||
{
|
||||
offset--;
|
||||
if(it->toEscapedString() == "%F0.")
|
||||
if(it->toUri() == "%F0.")
|
||||
{
|
||||
encaped = true;
|
||||
break;
|
||||
@@ -215,7 +215,7 @@ SyncSocket::onDataValidated(const shared_ptr<const Data>& data,
|
||||
const OnDataValidated& onValidated)
|
||||
{
|
||||
if(data->getName().size() > interestNameSize
|
||||
&& data->getName().get(interestNameSize).toEscapedString() == "INTRO-CERT")
|
||||
&& data->getName().get(interestNameSize).toUri() == "INTRO-CERT")
|
||||
{
|
||||
if(!m_withSecurity)
|
||||
return;
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ private:
|
||||
ndn::IdentityCertificate m_myCertificate;
|
||||
ndn::KeyChain m_keyChain;
|
||||
ndn::shared_ptr<ndn::Face> m_face;
|
||||
ndn::shared_ptr<boost::asio::io_service> m_ioService;
|
||||
boost::asio::io_service& m_ioService;
|
||||
bool m_withSecurity;
|
||||
ndn::shared_ptr<ndn::Validator> m_syncValidator;
|
||||
ndn::shared_ptr<SyncLogic> m_syncLogic;
|
||||
|
||||
@@ -139,9 +139,9 @@ public:
|
||||
class TestSet1{
|
||||
public:
|
||||
TestSet1(ndn::shared_ptr<boost::asio::io_service> ioService)
|
||||
: m_face1(new ndn::Face(ioService))
|
||||
, m_face2(new ndn::Face(ioService))
|
||||
, m_face3(new ndn::Face(ioService))
|
||||
: m_face1(new ndn::Face(*ioService))
|
||||
, m_face2(new ndn::Face(*ioService))
|
||||
, m_face3(new ndn::Face(*ioService))
|
||||
, m_name1("/irl.cs.ucla.edu/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
, m_name2("/yakshi.org/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
, m_name3("/google.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
@@ -298,8 +298,8 @@ public:
|
||||
class TestSet2{
|
||||
public:
|
||||
TestSet2(ndn::shared_ptr<boost::asio::io_service> ioService)
|
||||
: m_face1(new ndn::Face(ioService))
|
||||
, m_face2(new ndn::Face(ioService))
|
||||
: m_face1(new ndn::Face(*ioService))
|
||||
, m_face2(new ndn::Face(*ioService))
|
||||
, m_name1("/xiaonei.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
, m_name2("/mitbbs.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
{
|
||||
@@ -416,8 +416,8 @@ public:
|
||||
class TestSet3{
|
||||
public:
|
||||
TestSet3(ndn::shared_ptr<boost::asio::io_service> ioService)
|
||||
: m_face1(new ndn::Face(ioService))
|
||||
, m_face2(new ndn::Face(ioService))
|
||||
: m_face1(new ndn::Face(*ioService))
|
||||
, m_face2(new ndn::Face(*ioService))
|
||||
, m_name1("/xiaonei.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
, m_name2("/mitbbs.com/" + boost::lexical_cast<std::string>(ndn::time::toUnixTimestamp(ndn::time::system_clock::now()).count()))
|
||||
{
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include "sync-validator.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <ndn-cxx/util/scheduler.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(TestSyncValidator)
|
||||
|
||||
void
|
||||
@@ -68,7 +72,7 @@ BOOST_AUTO_TEST_CASE (Graph)
|
||||
shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName5);
|
||||
|
||||
shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
|
||||
shared_ptr<Face> face = make_shared<Face>(ioService);
|
||||
shared_ptr<Face> face = make_shared<Face>(ref(*ioService));
|
||||
shared_ptr<SecRuleRelative> rule;
|
||||
SyncValidator validator(prefix, *anchor, *face,
|
||||
bind(&publishData, _1, _2, _3),
|
||||
@@ -151,7 +155,7 @@ BOOST_AUTO_TEST_CASE (OfflineValidate)
|
||||
shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName5);
|
||||
|
||||
shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
|
||||
shared_ptr<Face> face = make_shared<Face>(ioService);
|
||||
shared_ptr<Face> face = make_shared<Face>(ref(*ioService));
|
||||
shared_ptr<SecRuleRelative> rule;
|
||||
SyncValidator validator(prefix, *anchor, *face,
|
||||
bind(&publishData, _1, _2, _3),
|
||||
@@ -246,7 +250,7 @@ struct FacesFixture
|
||||
void
|
||||
terminate(ndn::shared_ptr<ndn::Face> face)
|
||||
{
|
||||
face->ioService()->stop();
|
||||
face->getIoService().stop();
|
||||
}
|
||||
|
||||
const ndn::RegisteredPrefixId* regPrefixId;
|
||||
@@ -282,8 +286,8 @@ BOOST_FIXTURE_TEST_CASE(OnlineValidate, FacesFixture)
|
||||
shared_ptr<IdentityCertificate> introducee2 = keychain.getCertificate(certName4);
|
||||
|
||||
shared_ptr<boost::asio::io_service> ioService = make_shared<boost::asio::io_service>();
|
||||
shared_ptr<Face> face = make_shared<Face>(ioService);
|
||||
shared_ptr<Face> face2 = make_shared<Face>(ioService);
|
||||
shared_ptr<Face> face = make_shared<Face>(ref(*ioService));
|
||||
shared_ptr<Face> face2 = make_shared<Face>(ref(*ioService));
|
||||
|
||||
shared_ptr<SecRuleRelative> rule;
|
||||
shared_ptr<SyncValidator> validator = shared_ptr<SyncValidator>
|
||||
|
||||
Reference in new issue
Block a user