summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElisey Zamakhov <EZamakhov@luxoft.com>2014-07-14 17:13:01 +0400
committerElisey Zamakhov <EZamakhov@luxoft.com>2014-07-14 17:23:47 +0400
commitb88d85d013ba089ae13e1c6d981a9dbd84acc2cc (patch)
tree18f35a69c3498f43d598136050f4dc19bad6c852
parent5cfc85f47b4034804e4f859c3638faa1a2c3a917 (diff)
downloadsdl_core-b88d85d013ba089ae13e1c6d981a9dbd84acc2cc.tar.gz
Fix APPLINK-8161
Fix wrong logger levels
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc8
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc6
-rw-r--r--src/components/security_manager/include/security_manager/security_query.h4
-rw-r--r--test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h11
4 files changed, 16 insertions, 13 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index cc0f91bb96..abb87357f7 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -715,8 +715,6 @@ void ApplicationManagerImpl::OnMessageReceived(
if (outgoing_message) {
messages_from_mobile_.PostMessage(
impl::MessageFromMobile(outgoing_message));
- } else {
- LOG4CXX_WARN(logger_, "Incorrect message received");
}
}
@@ -819,7 +817,7 @@ bool ApplicationManagerImpl::IsAudioStreamingAllowed(uint32_t connection_key) co
ApplicationSharedPtr app = application(connection_key);
if (!app) {
- LOG4CXX_INFO(logger_, "An application is not registered.");
+ LOG4CXX_WARN(logger_, "An application is not registered.");
return false;
}
@@ -837,7 +835,7 @@ bool ApplicationManagerImpl::IsVideoStreamingAllowed(uint32_t connection_key) co
ApplicationSharedPtr app = application(connection_key);
if (!app) {
- LOG4CXX_INFO(logger_, "An application is not registered.");
+ LOG4CXX_WARN(logger_, "An application is not registered.");
return false;
}
@@ -1557,7 +1555,7 @@ utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
&&
message->service_type() != protocol_handler::kBulk) {
// skip this message, not under handling of ApplicationManager
- LOG4CXX_INFO(logger_, "Skipping message; not the under AM handling.");
+ LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
return outgoing_message;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index c3d1a84e29..f60beac24b 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -480,7 +480,7 @@ void ProtocolHandlerImpl::OnTMMessageReceiveFailed(
}
void ProtocolHandlerImpl::NotifySubscribers(const RawMessagePtr message) {
- LOG4CXX_ERROR(logger_, "ProtocolHandlerImpl::NotifySubscribers");
+ LOG4CXX_TRACE(logger_, "ProtocolHandlerImpl::NotifySubscribers");
sync_primitives::AutoLock lock(protocol_observers_lock_);
for (ProtocolObservers::iterator it = protocol_observers_.begin();
protocol_observers_.end() != it; ++it) {
@@ -489,7 +489,7 @@ void ProtocolHandlerImpl::NotifySubscribers(const RawMessagePtr message) {
}
void ProtocolHandlerImpl::OnTMMessageSend(const RawMessagePtr message) {
- LOG4CXX_INFO(logger_, "Sending message finished successfully.");
+ LOG4CXX_DEBUG(logger_, "Sending message finished successfully.");
uint32_t connection_handle = 0;
uint8_t sessionID = 0;
@@ -1036,6 +1036,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
return RESULT_OK;
}
if (ssl_context->IsInitCompleted()) {
+ // mark service as protected
+ session_observer_->SetProtectionFlag(connection_key, service_type);
// Start service as protected with current SSLContext
SendStartSessionAck(connection_id, session_id, packet.protocol_version(),
connection_key, packet.service_type(), PROTECTION_ON);
diff --git a/src/components/security_manager/include/security_manager/security_query.h b/src/components/security_manager/include/security_manager/security_query.h
index 9c8f78536f..944553e64c 100644
--- a/src/components/security_manager/include/security_manager/security_query.h
+++ b/src/components/security_manager/include/security_manager/security_query.h
@@ -76,12 +76,12 @@ class SecurityQuery {
ERROR_NOT_SUPPORTED = 0x03, // SDL does not support encryption
ERROR_SERVICE_ALREADY_PROTECTED = 0x04,
ERROR_SERVICE_NOT_PROTECTED = 0x05, // got handshake or encrypted data
- // for not protected service ???
+ // for not protected service
ERROR_DECRYPTION_FAILED = 0x06,
ERROR_ENCRYPTION_FAILED = 0x07,
ERROR_SSL_INVALID_DATA = 0x08,
ERROR_INTERNAL = 0xFF,
- ERROR_UNKWOWN_INTERNAL_ERROR = 0xFE // error valeu for testing
+ ERROR_UNKWOWN_INTERNAL_ERROR = 0xFE // error value for testing
};
/**
* \brief QueryHeader is 12 byte header of security query
diff --git a/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h b/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
index 51c9732197..9a8998081b 100644
--- a/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
+++ b/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
@@ -369,13 +369,16 @@ TEST_F(ProtocolHandlerImplTest,SecurityEnable_StartSessionProtected_SSLInitializ
//emulate SSL is initilized
WillOnce(Return(true));
+ // Expect service protection enable
+ EXPECT_CALL(session_observer_mock,
+ SetProtectionFlag(connection_key, start_service));
+
// expect send Ack with PROTECTION_ON (on SSL is initilized)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON))).
WillOnce(Return(E_SUCCESS));
SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
-
}
/*
* ProtocolHandler shall send Ack with PROTECTION_OFF on session handshhake fail
@@ -470,7 +473,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSu
// emulate protection for service is not enabled
WillOnce(ReturnNull());
- // On success handshake mark service as protected
+ // Expect service protection enable
EXPECT_CALL(session_observer_mock,
SetProtectionFlag(connection_key, start_service));
@@ -525,7 +528,7 @@ TEST_F(ProtocolHandlerImplTest,
// emulate protection for service is not enabled
WillOnce(ReturnNull());
- // On success handshake mark service as protected
+ // Expect service protection enable
EXPECT_CALL(session_observer_mock,
SetProtectionFlag(connection_key, start_service));
@@ -584,7 +587,7 @@ TEST_F(ProtocolHandlerImplTest,
// emulate protection for service is not enabled
WillOnce(ReturnNull());
- // On success handshake mark service as protected
+ // Expect service protection enable
EXPECT_CALL(session_observer_mock,
SetProtectionFlag(connection_key, start_service));