summaryrefslogtreecommitdiff
path: root/src/components/connection_handler/src/connection.cc
diff options
context:
space:
mode:
authorAndriy Byzhynar <AByzhynar@luxoft.com>2017-12-20 16:32:22 +0200
committerAndriy Byzhynar <AByzhynar@luxoft.com>2018-05-15 11:23:06 +0300
commit5a17a42bfd22e3588c562b097f9ce8f7dd966583 (patch)
tree6f235d62e3da8d0c5fde2f2cfbbc66f577b8d8bc /src/components/connection_handler/src/connection.cc
parent5b3764d30b66004c4716d44117dea7e7aa4ba119 (diff)
downloadsdl_core-5a17a42bfd22e3588c562b097f9ce8f7dd966583.tar.gz
Fix wrong connection closure
Removed connection closure in case of last session in the connection was closed. All connections should be removed when device would be unplugged.
Diffstat (limited to 'src/components/connection_handler/src/connection.cc')
-rw-r--r--src/components/connection_handler/src/connection.cc7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 16b88c4164..6bed3e96bc 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -346,7 +346,6 @@ const SessionMap Connection::session_map() const {
}
void Connection::CloseSession(uint8_t session_id) {
- size_t size;
{
sync_primitives::AutoLock lock(session_map_lock_);
@@ -354,16 +353,10 @@ void Connection::CloseSession(uint8_t session_id) {
if (session_it == session_map_.end()) {
return;
}
- size = session_map_.size();
}
connection_handler_->CloseSession(
connection_handle_, session_id, connection_handler::kCommon);
-
- // Close connection if it is last session
- if (1 == size) {
- connection_handler_->CloseConnection(connection_handle_);
- }
}
void Connection::UpdateProtocolVersionSession(uint8_t session_id,