summaryrefslogtreecommitdiff
path: root/src/components/connection_handler/src/connection_handler_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/connection_handler/src/connection_handler_impl.cc')
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 7ea9efa1cc..5b26304302 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -753,12 +753,11 @@ struct CompareMAC {
bool ConnectionHandlerImpl::GetDeviceID(const std::string& mac_address,
DeviceHandle* device_handle) {
+ DCHECK_OR_RETURN(device_handle, false);
DeviceMap::const_iterator it = std::find_if(
device_list_.begin(), device_list_.end(), CompareMAC(mac_address));
if (it != device_list_.end()) {
- if (device_handle) {
- *device_handle = it->first;
- }
+ *device_handle = it->first;
return true;
}
return false;
@@ -775,7 +774,7 @@ int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
int32_t result = -1;
DeviceMap::const_iterator it = device_list_.find(device_handle);
if (device_list_.end() == it) {
- LOG4CXX_ERROR(logger_, "Device not found!");
+ LOG4CXX_ERROR(logger_, "Device not found for handle " << device_handle);
return result;
}
@@ -878,6 +877,13 @@ void ConnectionHandlerImpl::SetProtectionFlag(
connection.SetProtectionFlag(session_id, service_type);
}
+security_manager::SSLContext::HandshakeContext
+ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
+ return connection_handler_observer_->GetHandshakeContext(key);
+}
+
+#endif // ENABLE_SECURITY
+
bool ConnectionHandlerImpl::SessionServiceExists(
const uint32_t connection_key,
const protocol_handler::ServiceType& service_type) const {
@@ -896,13 +902,6 @@ bool ConnectionHandlerImpl::SessionServiceExists(
return connection.SessionServiceExists(session_id, service_type);
}
-security_manager::SSLContext::HandshakeContext
-ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
- return connection_handler_observer_->GetHandshakeContext(key);
-}
-
-#endif // ENABLE_SECURITY
-
void ConnectionHandlerImpl::StartDevicesDiscovery() {
LOG4CXX_AUTO_TRACE(logger_);