summaryrefslogtreecommitdiff
path: root/src/components/protocol_handler
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2017-12-04 12:21:00 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2017-12-04 12:21:00 -0500
commita8c3e2ac28d758b30a2b933918635ef33f2d4cd3 (patch)
tree8f0871c23af4b53351a0aad30a87642cd2b3a024 /src/components/protocol_handler
parent8c94933f0d3be1ac6c6e4e88bf46dd02b52f62a6 (diff)
downloadsdl_core-a8c3e2ac28d758b30a2b933918635ef33f2d4cd3.tar.gz
Add DEPRECATED macro, and fix resulting deprecated warnings
Diffstat (limited to 'src/components/protocol_handler')
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h4
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc26
2 files changed, 16 insertions, 14 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
index c5a45c0dfe..90aad65ed4 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
@@ -553,8 +553,8 @@ class ProtocolHandlerImpl
RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet);
- // DEPRECATED
- RESULT_CODE HandleControlMessageStartSession(const ProtocolPacket& packet);
+ DEPRECATED RESULT_CODE
+ HandleControlMessageStartSession(const ProtocolPacket& packet);
RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet);
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 23ac2927ef..921f27873f 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -1173,12 +1173,12 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
LOG4CXX_AUTO_TRACE(logger_);
const uint8_t current_session_id = packet.session_id();
- const uint32_t hash_id = get_hash_id(packet);
+ uint32_t hash_id = get_hash_id(packet);
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
const ConnectionID connection_id = packet.connection_id();
const uint32_t session_key = session_observer_.OnSessionEndedCallback(
- connection_id, current_session_id, hash_id, service_type);
+ connection_id, current_session_id, &hash_id, service_type);
if (0 == session_key) {
LOG4CXX_WARN(logger_, "Refused to end service");
@@ -1307,8 +1307,9 @@ class StartSessionHandler : public security_manager::SecurityManagerListener {
} // namespace
#endif // ENABLE_SECURITY
-// DEPRECATED
-RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+DEPRECATED RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
const ProtocolPacket& packet) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(
@@ -1461,6 +1462,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
}
return RESULT_OK;
}
+#pragma GCC diagnostic pop
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
const ProtocolFramePtr packet) {
@@ -1895,11 +1897,11 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
connection_key,
security_manager::SecurityManager::ERROR_ENCRYPTION_FAILED,
error_text);
+
+ uint32_t hash_id = packet->message_id();
// Close session to prevent usage unprotected service/session
- session_observer_.OnSessionEndedCallback(packet->connection_id(),
- packet->session_id(),
- packet->message_id(),
- kRpc);
+ session_observer_.OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(), &hash_id, kRpc);
return RESULT_OK;
}
LOG4CXX_DEBUG(logger_,
@@ -1948,11 +1950,11 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
connection_key,
security_manager::SecurityManager::ERROR_DECRYPTION_FAILED,
error_text);
+
+ uint32_t hash_id = packet->message_id();
// Close session to prevent usage unprotected service/session
- session_observer_.OnSessionEndedCallback(packet->connection_id(),
- packet->session_id(),
- packet->message_id(),
- kRpc);
+ session_observer_.OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(), &hash_id, kRpc);
return RESULT_ENCRYPTION_FAILED;
}
LOG4CXX_DEBUG(logger_,