aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-06-02 18:52:39 +0200
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-03 16:21:49 +0200
commit5d8156ea4c34f9a3cb986da16a71faebfb2add6b (patch)
tree5895f7546c91eab1c6cad917f3a41594a543ca64 /libtransport
parent15458966a342caa0912b7806a755d0d8277ca00f (diff)
[HICN-622] Add stop() functionality to http proxy.
Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I9091cd8ef0f9da869b886541a0116adf3f30e6b9 Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/CMakeLists.txt3
-rw-r--r--libtransport/includes/hicn/transport/utils/event_thread.h8
2 files changed, 4 insertions, 7 deletions
diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt
index c431ace04..67492cb11 100644
--- a/libtransport/CMakeLists.txt
+++ b/libtransport/CMakeLists.txt
@@ -52,9 +52,6 @@ set(TRANSPORT_HTTP ${TRANSPORT_ROOT_PATH}/http)
set(TRANSPORT_PORTABILITY ${TRANSPORT_ROOT_PATH}/portability)
set(TRANSPORT_INTERFACES ${TRANSPORT_ROOT_PATH}/interfaces)
-# Install includes
-set(INSTALL_INCLUDE_DIR include/hicn/transport)
-
set(LIBTRANSPORT hicntransport)
if ((BUILD_HICNPLUGIN OR BUILD_MEMIF_CONNECTOR) AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(__vpp__ 1)
diff --git a/libtransport/includes/hicn/transport/utils/event_thread.h b/libtransport/includes/hicn/transport/utils/event_thread.h
index db1194821..702c98f8d 100644
--- a/libtransport/includes/hicn/transport/utils/event_thread.h
+++ b/libtransport/includes/hicn/transport/utils/event_thread.h
@@ -34,7 +34,7 @@ class EventThread {
explicit EventThread(asio::io_service& io_service)
: internal_io_service_(nullptr),
io_service_(io_service),
- work_(io_service_),
+ work_(std::make_unique<asio::io_service::work>(io_service_)),
thread_(nullptr) {
run();
}
@@ -42,7 +42,7 @@ class EventThread {
explicit EventThread()
: internal_io_service_(std::make_unique<asio::io_service>()),
io_service_(*internal_io_service_),
- work_(io_service_),
+ work_(std::make_unique<asio::io_service::work>(io_service_)),
thread_(nullptr) {
run();
}
@@ -78,7 +78,7 @@ class EventThread {
}
void stop() {
- io_service_.stop();
+ work_.reset();
if (thread_ && thread_->joinable()) {
thread_->join();
@@ -94,7 +94,7 @@ class EventThread {
private:
std::unique_ptr<asio::io_service> internal_io_service_;
asio::io_service& io_service_;
- asio::io_service::work work_;
+ std::unique_ptr<asio::io_service::work> work_;
std::unique_ptr<std::thread> thread_;
};