summaryrefslogtreecommitdiff
path: root/src/components/connection_handler/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/connection_handler/src')
-rw-r--r--src/components/connection_handler/src/connection.cc21
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc60
-rw-r--r--src/components/connection_handler/src/device.cc6
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc14
4 files changed, 51 insertions, 50 deletions
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 3f5b0e1901..304be9ddb0 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -37,13 +37,13 @@
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
#include "protocol_handler/protocol_packet.h"
+#include "utils/helpers.h"
#include "utils/logger.h"
#include "utils/macro.h"
-#include "utils/helpers.h"
#ifdef ENABLE_SECURITY
-#include "security_manager/ssl_context.h"
#include "security_manager/security_manager.h"
+#include "security_manager/ssl_context.h"
#endif // ENABLE_SECURITY
/**
@@ -190,12 +190,11 @@ bool Connection::AddNewService(uint8_t session_id,
Session& session = session_it->second;
if (session.protocol_version <= protocol_handler::PROTOCOL_VERSION_2 &&
- helpers::Compare<protocol_handler::ServiceType,
- helpers::EQ,
- helpers::ONE>(
- service_type,
- protocol_handler::ServiceType::kAudio,
- protocol_handler::ServiceType::kMobileNav)) {
+ helpers::
+ Compare<protocol_handler::ServiceType, helpers::EQ, helpers::ONE>(
+ service_type,
+ protocol_handler::ServiceType::kAudio,
+ protocol_handler::ServiceType::kMobileNav)) {
LOG4CXX_WARN(logger_,
"Audio and video services are disallowed for protocol version "
"2 or lower");
@@ -265,8 +264,10 @@ bool Connection::RemoveService(uint8_t session_id,
find(service_list.begin(), service_list.end(), service_type);
if (service_list.end() == service_it) {
LOG4CXX_WARN(logger_,
- "Session " << session_id << " didn't established"
- " service " << service_type);
+ "Session " << session_id
+ << " didn't established"
+ " service "
+ << service_type);
return false;
}
service_list.erase(service_it);
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index c412c9c637..84609d47b8 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -31,14 +31,14 @@
*/
#include <strings.h>
-#include <string>
-#include <list>
#include <algorithm>
+#include <list>
#include <memory>
+#include <string>
#include "connection_handler/connection_handler_impl.h"
-#include "transport_manager/info.h"
#include "encryption/hashing.h"
+#include "transport_manager/info.h"
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager.h"
@@ -95,9 +95,9 @@ void ConnectionHandlerImpl::Stop() {
void ConnectionHandlerImpl::set_connection_handler_observer(
ConnectionHandlerObserver* observer) {
- LOG4CXX_DEBUG(logger_,
- "ConnectionHandlerImpl::set_connection_handler_observer() "
- << observer);
+ LOG4CXX_DEBUG(
+ logger_,
+ "ConnectionHandlerImpl::set_connection_handler_observer() " << observer);
sync_primitives::AutoWriteLock write_lock(connection_handler_observer_lock_);
if (!observer) {
LOG4CXX_WARN(logger_, "Set Null pointer to observer.");
@@ -107,9 +107,9 @@ void ConnectionHandlerImpl::set_connection_handler_observer(
void ConnectionHandlerImpl::set_protocol_handler(
protocol_handler::ProtocolHandler* protocol_handler) {
- LOG4CXX_DEBUG(logger_,
- "ConnectionHandlerImpl::set_protocol_handler()"
- << protocol_handler);
+ LOG4CXX_DEBUG(
+ logger_,
+ "ConnectionHandlerImpl::set_protocol_handler()" << protocol_handler);
if (!protocol_handler) {
LOG4CXX_WARN(logger_, "Set Null pointer to protocol handler.");
}
@@ -392,9 +392,9 @@ bool AllowProtection(const ConnectionHandlerSettings& settings,
if (std::find(force_unprotected_list.begin(),
force_unprotected_list.end(),
service_type) != force_unprotected_list.end()) {
- LOG4CXX_ERROR(logger_,
- "Service " << static_cast<int>(service_type)
- << " shall be protected");
+ LOG4CXX_ERROR(
+ logger_,
+ "Service " << static_cast<int>(service_type) << " shall be protected");
return false;
}
LOG4CXX_DEBUG(logger_,
@@ -686,34 +686,34 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
KeyFromPair(primary_connection_handle, session_id);
if (protocol_handler::kRpc == service_type) {
- LOG4CXX_INFO(logger_,
- "Session " << static_cast<uint32_t>(session_id)
- << " to be removed");
+ LOG4CXX_INFO(
+ logger_,
+ "Session " << static_cast<uint32_t>(session_id) << " to be removed");
// old version of protocol doesn't support hash
if (protocol_handler::HASH_ID_NOT_SUPPORTED != *hashCode) {
if (protocol_handler::HASH_ID_WRONG == *hashCode ||
session_key != *hashCode) {
- LOG4CXX_WARN(logger_,
- "Wrong hash_id for session "
- << static_cast<uint32_t>(session_id));
+ LOG4CXX_WARN(
+ logger_,
+ "Wrong hash_id for session " << static_cast<uint32_t>(session_id));
*hashCode = protocol_handler::HASH_ID_WRONG;
return 0;
}
}
if (!connection->RemoveSession(session_id)) {
- LOG4CXX_WARN(logger_,
- "Couldn't remove session "
- << static_cast<uint32_t>(session_id));
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't remove session " << static_cast<uint32_t>(session_id));
return 0;
}
} else {
- LOG4CXX_INFO(logger_,
- "Service " << static_cast<uint32_t>(service_type)
- << " to be removed");
+ LOG4CXX_INFO(
+ logger_,
+ "Service " << static_cast<uint32_t>(service_type) << " to be removed");
if (!connection->RemoveService(session_id, service_type)) {
- LOG4CXX_WARN(logger_,
- "Couldn't remove service "
- << static_cast<uint32_t>(service_type));
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't remove service " << static_cast<uint32_t>(service_type));
return 0;
}
}
@@ -1480,9 +1480,9 @@ void ConnectionHandlerImpl::CloseSession(ConnectionHandle connection_handle,
return;
}
- LOG4CXX_DEBUG(logger_,
- "Session with id: " << session_id
- << " has been closed successfully");
+ LOG4CXX_DEBUG(
+ logger_,
+ "Session with id: " << session_id << " has been closed successfully");
}
void ConnectionHandlerImpl::CloseConnectionSessions(
diff --git a/src/components/connection_handler/src/device.cc b/src/components/connection_handler/src/device.cc
index 0ecb439172..515304778b 100644
--- a/src/components/connection_handler/src/device.cc
+++ b/src/components/connection_handler/src/device.cc
@@ -54,9 +54,9 @@ Device::Device(DeviceHandle device_handle,
, mac_address_(mac_address)
, connection_type_(connection_type) {
mac_address_ = encryption::MakeHash(mac_address);
- LOG4CXX_DEBUG(logger_,
- "Device: MAC address - " << mac_address << ", hash - "
- << mac_address_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Device: MAC address - " << mac_address << ", hash - " << mac_address_);
}
DeviceHandle Device::device_handle() const {
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index 4c2d5899af..2b50f1ce1b 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -34,8 +34,8 @@
#include <unistd.h>
#include <utility>
-#include "utils/logger.h"
#include "connection_handler/connection.h"
+#include "utils/logger.h"
namespace connection_handler {
@@ -79,9 +79,9 @@ void HeartBeatMonitor::Process() {
void HeartBeatMonitor::threadMain() {
AutoLock main_lock(main_thread_lock_);
- LOG4CXX_DEBUG(logger_,
- "Start heart beat monitor. Timeout is "
- << default_heartbeat_timeout_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Start heart beat monitor. Timeout is " << default_heartbeat_timeout_);
while (run_) {
heartbeat_monitor_.WaitFor(main_lock, kDefaultCycleTimeout);
Process();
@@ -94,9 +94,9 @@ void HeartBeatMonitor::AddSession(uint8_t session_id) {
LOG4CXX_DEBUG(logger_, "Add session with id " << converted_session_id);
AutoLock auto_lock(sessions_list_lock_);
if (sessions_.end() != sessions_.find(session_id)) {
- LOG4CXX_WARN(logger_,
- "Session with id: " << converted_session_id
- << " already exists");
+ LOG4CXX_WARN(
+ logger_,
+ "Session with id: " << converted_session_id << " already exists");
return;
}
sessions_.insert(