From a6bd7da5592cdd535cee66d5ca9a1c4e46270181 Mon Sep 17 00:00:00 2001 From: Alexander Afanasyev Date: Thu, 25 Apr 2019 17:26:11 -0400 Subject: [PATCH] build: Remove unnecessary std::ref, causing compilation issues with Boost 1.70.0 Refs: #4923 Change-Id: Idba1abe89161b11b1ec80fdceac51e2b00ed507b --- .gitmodules | 2 +- .waf-tools/websocket.py | 2 +- daemon/face/tcp-channel.cpp | 2 +- daemon/face/tcp-transport.cpp | 8 +++++++- daemon/face/websocket-channel.cpp | 2 +- tests/daemon/face/tcp-transport.t.cpp | 4 ++-- tests/daemon/face/websocket-transport-fixture.hpp | 2 +- websocketpp | 2 +- 8 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0b8f2ee5..edc03cc7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "websocketpp"] path = websocketpp - url = https://github.com/zaphoyd/websocketpp.git + url = https://github.com/cawka/websocketpp.git diff --git a/.waf-tools/websocket.py b/.waf-tools/websocket.py index 33a1ff6b..1c5fef5c 100644 --- a/.waf-tools/websocket.py +++ b/.waf-tools/websocket.py @@ -65,7 +65,7 @@ def checkWebsocket(self, **kw): Logs.warn(' git submodule update --init') Logs.warn('Otherwise, manually download and extract the websocketpp library:') Logs.warn(' mkdir -p websocketpp') - Logs.warn(' curl -L https://github.com/zaphoyd/websocketpp/archive/0.8.1.tar.gz > websocketpp.tar.gz') + Logs.warn(' curl -L https://github.com/cawka/websocketpp/archive/0.8.1-hotfix.tar.gz > websocketpp.tar.gz') Logs.warn(' tar xf websocketpp.tar.gz -C websocketpp/ --strip 1') Logs.warn('Alternatively, WebSocket support can be disabled with --without-websocket') self.fatal('WebSocket++ not found') diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp index dc0576f6..a26c91e7 100644 --- a/daemon/face/tcp-channel.cpp +++ b/daemon/face/tcp-channel.cpp @@ -83,7 +83,7 @@ TcpChannel::connect(const tcp::Endpoint& remoteEndpoint, return; } - auto clientSocket = make_shared(std::ref(getGlobalIoService())); + auto clientSocket = make_shared(getGlobalIoService()); auto timeoutEvent = getScheduler().schedule(timeout, [=] { handleConnectTimeout(remoteEndpoint, clientSocket, onConnectFailed); }); diff --git a/daemon/face/tcp-transport.cpp b/daemon/face/tcp-transport.cpp index 58c4add4..0da07af9 100644 --- a/daemon/face/tcp-transport.cpp +++ b/daemon/face/tcp-transport.cpp @@ -133,7 +133,13 @@ TcpTransport::reconnect() BOOST_ASSERT(getState() == TransportState::DOWN); // recreate the socket - m_socket = protocol::socket(m_socket.get_io_service()); + m_socket = protocol::socket( +#if BOOST_VERSION >= 107000 + m_socket.get_executor() +#else + m_socket.get_io_service() +#endif // BOOST_VERSION >= 107000 + ); this->resetReceiveBuffer(); this->resetSendQueue(); diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp index f3f69ba4..20b66863 100644 --- a/daemon/face/websocket-channel.cpp +++ b/daemon/face/websocket-channel.cpp @@ -123,7 +123,7 @@ WebSocketChannel::handleOpen(websocketpp::connection_hdl hdl) NFD_LOG_CHAN_TRACE("Incoming connection from " << m_server.get_con_from_hdl(hdl)->get_remote_endpoint()); auto linkService = make_unique(); - auto transport = make_unique(hdl, std::ref(m_server), m_pingInterval); + auto transport = make_unique(hdl, m_server, m_pingInterval); auto face = make_shared(std::move(linkService), std::move(transport)); BOOST_ASSERT(m_channelFaces.count(hdl) == 0); diff --git a/tests/daemon/face/tcp-transport.t.cpp b/tests/daemon/face/tcp-transport.t.cpp index 0b573f34..81da009b 100644 --- a/tests/daemon/face/tcp-transport.t.cpp +++ b/tests/daemon/face/tcp-transport.t.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2018, Regents of the University of California, + * Copyright (c) 2014-2019, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & Marie Curie, Sorbonne University, @@ -177,7 +177,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(PermanentReconnectWithExponentialBackoff, T, Tc BOOST_REQUIRE_EQUAL(this->limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS); auto transportObserver = - make_unique(std::move(sock), std::ref(this->limitedIo)); + make_unique(std::move(sock), this->limitedIo); BOOST_REQUIRE_EQUAL(transportObserver->getState(), TransportState::UP); // break the TCP connection diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp index bcf9cf93..e49d4216 100644 --- a/tests/daemon/face/websocket-transport-fixture.hpp +++ b/tests/daemon/face/websocket-transport-fixture.hpp @@ -110,7 +110,7 @@ protected: 1_s), LimitedIo::EXCEED_OPS); face = make_unique(make_unique(), - make_unique(serverHdl, std::ref(server), pingInterval)); + make_unique(serverHdl, server, pingInterval)); transport = static_cast(face->getTransport()); serverReceivedPackets = &static_cast(face->getLinkService())->receivedPackets; diff --git a/websocketpp b/websocketpp index c6d7e295..ac4e0213 160000 --- a/websocketpp +++ b/websocketpp @@ -1 +1 @@ -Subproject commit c6d7e295bf5a0ab9b5f896720cc1a0e0fdc397a7 +Subproject commit ac4e021333675fc80b96eb7be45d218581c897e2