diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp index c9a4690a..d06195e9 100644 --- a/tests/daemon/face/transport.t.cpp +++ b/tests/daemon/face/transport.t.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/** - * Copyright (c) 2014-2017, 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, @@ -29,12 +29,14 @@ #include "dummy-receive-link-service.hpp" #include "transport-test-common.hpp" -#include +#include #include -#include +#include #include +#include +#include #include -#include +#include namespace nfd { namespace face { @@ -93,6 +95,7 @@ BOOST_AUTO_TEST_CASE(PersistencyChange) } /** \brief a macro to declare a TransportState as a integral constant + * \note we cannot use mpl::integral_c because TransportState is not an integral type */ #define TRANSPORT_STATE_C(X) mpl::int_(TransportState::X)> @@ -141,28 +144,23 @@ typedef mpl::set< mpl::pair > ValidStateTransitions; -/** \brief a metafunction class to generate a sequence of all state transitions +/** \brief a metafunction to generate a sequence of all state transitions * from a specified state */ -struct StateTransitionsFrom +template +struct StateTransitionsFrom : mpl::fold< + States, + Result, + mpl::push_back>> { - template - struct apply - { - typedef typename mpl::fold< - States, - mpl::vector<>, - mpl::push_back> - >::type type; - }; }; /** \brief a sequence of all state transitions */ typedef mpl::fold< States, - mpl::empty_sequence, - mpl::joint_view>::type> + mpl::vector<>, + mpl::lambda> >::type AllStateTransitions; #undef TRANSPORT_STATE_C diff --git a/tools/ndn-autoconfig/ndn-fch-discovery.cpp b/tools/ndn-autoconfig/ndn-fch-discovery.cpp index 53654969..ef58ab5a 100644 --- a/tools/ndn-autoconfig/ndn-fch-discovery.cpp +++ b/tools/ndn-autoconfig/ndn-fch-discovery.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2017, 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, @@ -26,6 +26,7 @@ #include "ndn-fch-discovery.hpp" #include +#include #include #include @@ -144,22 +145,22 @@ void NdnFchDiscovery::doStart() { try { - using namespace boost::asio::ip; - tcp::iostream requestStream; - - requestStream.expires_from_now(boost::posix_time::milliseconds(3000)); + boost::asio::ip::tcp::iostream requestStream; +#if BOOST_VERSION >= 106700 + requestStream.expires_after(std::chrono::seconds(3)); +#else + requestStream.expires_from_now(boost::posix_time::seconds(3)); +#endif // BOOST_VERSION >= 106700 Url url(m_url); if (!url.isValid()) { BOOST_THROW_EXCEPTION(HttpException("Invalid NDN-FCH URL: " + m_url)); } - if (!boost::iequals(url.getScheme(), "http")) { BOOST_THROW_EXCEPTION(HttpException("Only http:// NDN-FCH URLs are supported")); } requestStream.connect(url.getHost(), url.getPort()); - if (!requestStream) { BOOST_THROW_EXCEPTION(HttpException("HTTP connection error to " + m_url)); } @@ -198,7 +199,6 @@ NdnFchDiscovery::doStart() std::string hubHost; requestStream >> hubHost; - if (hubHost.empty()) { BOOST_THROW_EXCEPTION(HttpException("NDN-FCH did not return hub host")); }