summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Gehring <juergen.gehring@bmw.de>2018-05-22 02:56:45 -0700
committerJuergen Gehring <juergen.gehring@bmw.de>2018-05-22 02:56:45 -0700
commitf5d9ec214df655dc49305399215e00d16231fecd (patch)
treedb25f4ba3e625abe3629af91ee3fefbdb46be21c
parent8b950ebd7d0d0ed349b7f59255cb1a157ceede3c (diff)
downloadvSomeIP-f5d9ec214df655dc49305399215e00d16231fecd.tar.gz
vsomeip 2.10.192.10.19
-rw-r--r--CHANGES5
-rw-r--r--CMakeLists.txt2
-rw-r--r--implementation/endpoints/src/tcp_client_endpoint_impl.cpp3
-rw-r--r--implementation/runtime/src/application_impl.cpp77
4 files changed, 53 insertions, 34 deletions
diff --git a/CHANGES b/CHANGES
index c65c8ef..0f7aa15 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
Changes
=======
+v2.10.19
+- Catch exceptions on shutdown (especially from boost::log)
+- Fixed handling of malformed packets in TCP client endpoint in conjunction
+ with magic cookies
+
v2.10.18
- Fix restarting of TCP connection on connection reset by the server
and mark services reachable through it as unavailable until
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cb9b56..1bb01ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@ project (vsomeip)
set (VSOMEIP_MAJOR_VERSION 2)
set (VSOMEIP_MINOR_VERSION 10)
-set (VSOMEIP_PATCH_VERSION 18)
+set (VSOMEIP_PATCH_VERSION 19)
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentatin/doxygen.in
set (CMAKE_VERBOSE_MAKEFILE off)
diff --git a/implementation/endpoints/src/tcp_client_endpoint_impl.cpp b/implementation/endpoints/src/tcp_client_endpoint_impl.cpp
index 056e743..102d0fe 100644
--- a/implementation/endpoints/src/tcp_client_endpoint_impl.cpp
+++ b/implementation/endpoints/src/tcp_client_endpoint_impl.cpp
@@ -507,6 +507,9 @@ void tcp_client_endpoint_impl::receive_cbk(
_recv_buffer_size -= its_offset;
its_iteration_gap += its_offset;
has_full_message = true; // trigger next loop
+ } else {
+ _recv_buffer_size = 0;
+ its_missing_capacity = 0;
}
} else {
VSOMEIP_ERROR << "tce::c<" << this
diff --git a/implementation/runtime/src/application_impl.cpp b/implementation/runtime/src/application_impl.cpp
index 065e6a3..d079816 100644
--- a/implementation/runtime/src/application_impl.cpp
+++ b/implementation/runtime/src/application_impl.cpp
@@ -1875,46 +1875,57 @@ void application_impl::shutdown() {
is_dispatching_ = false;
dispatcher_condition_.notify_all();
}
- {
- std::lock_guard<std::mutex> its_lock(dispatcher_mutex_);
- for (auto its_dispatcher : dispatchers_) {
- if (its_dispatcher.second->get_id() != stop_caller_id_) {
- if (its_dispatcher.second->joinable()) {
- its_dispatcher.second->join();
+
+ try {
+
+ {
+ std::lock_guard<std::mutex> its_lock(dispatcher_mutex_);
+ for (auto its_dispatcher : dispatchers_) {
+ if (its_dispatcher.second->get_id() != stop_caller_id_) {
+ if (its_dispatcher.second->joinable()) {
+ its_dispatcher.second->join();
+ }
+ } else {
+ // If the caller of stop() is one of our dispatchers
+ // it can happen the shutdown mechanism will block
+ // as that thread probably can't be joined. The reason
+ // is the caller of stop() probably wants to join the
+ // thread once call start (which got to the IO-Thread)
+ // and which is expected to return after stop() has been
+ // called.
+ // Therefore detach this thread instead of joining because
+ // after it will return to "main_dispatch" it will be
+ // properly shutdown anyways because "is_dispatching_"
+ // was set to "false" here.
+ its_dispatcher.second->detach();
}
- } else {
- // If the caller of stop() is one of our dispatchers
- // it can happen the shutdown mechanism will block
- // as that thread probably can't be joined. The reason
- // is the caller of stop() probably wants to join the
- // thread once call start (which got to the IO-Thread)
- // and which is expected to return after stop() has been
- // called.
- // Therefore detach this thread instead of joining because
- // after it will return to "main_dispatch" it will be
- // properly shutdown anyways because "is_dispatching_"
- // was set to "false" here.
- its_dispatcher.second->detach();
}
+ availability_handlers_.clear();
+ running_dispatchers_.clear();
+ elapsed_dispatchers_.clear();
+ dispatchers_.clear();
}
- availability_handlers_.clear();
- running_dispatchers_.clear();
- elapsed_dispatchers_.clear();
- dispatchers_.clear();
- }
- if (routing_)
- routing_->stop();
+ if (routing_)
+ routing_->stop();
- work_.reset();
- io_.stop();
+ work_.reset();
+ io_.stop();
- {
- std::lock_guard<std::mutex> its_lock_start_stop(start_stop_mutex_);
- for (auto t : io_threads_) {
- t->join();
+ {
+ std::lock_guard<std::mutex> its_lock_start_stop(start_stop_mutex_);
+ for (auto t : io_threads_) {
+ t->join();
+ }
+ io_threads_.clear();
}
- io_threads_.clear();
+#ifndef _WIN32
+ } catch (const boost::log::v2_mt_posix::system_error &e) {
+ std::cerr << "catched boost::log system_error in stop thread" << std::endl <<
+ boost::current_exception_diagnostic_information();
+#endif
+ } catch (const std::exception &e) {
+ VSOMEIP_ERROR << "application_impl::shutdown() catched exception: " << e.what();
}
}