summaryrefslogtreecommitdiff
path: root/src/components/protocol_handler
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-12-26 18:25:27 +0200
committerAKalinich-Luxoft <AKalinich@luxoft.com>2018-01-29 09:06:29 +0200
commit4ce09f81793c0a2df3826e412831a1ddd0a5ce54 (patch)
treeeb2ed409473b5fc9ece82118b7016e5b2484c0eb /src/components/protocol_handler
parent45f6356cc4194a88f5de88e6df88241efcd7c9f3 (diff)
downloadsdl_core-4ce09f81793c0a2df3826e412831a1ddd0a5ce54.tar.gz
Minor refactoring in protocol and security manager
Added consts for some methods. Fixed typos in description. Renamed some non informative variables names.
Diffstat (limited to 'src/components/protocol_handler')
-rw-r--r--src/components/protocol_handler/include/protocol_handler/handshake_handler.h12
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc11
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc2
3 files changed, 15 insertions, 10 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
index 12e617f2a4..0ef40290f2 100644
--- a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
@@ -45,7 +45,7 @@ namespace protocol_handler {
class ProtocolHandlerImpl;
/**
- * \brief HandshakeHandler class for handling SSL handshake and sending
+ * @brief HandshakeHandler class for handling SSL handshake and sending
* Ack/Nack on its success or fail
*/
class HandshakeHandler : public security_manager::SecurityManagerListener {
@@ -77,13 +77,13 @@ class HandshakeHandler : public security_manager::SecurityManagerListener {
* @param reference to string where to save certificate data
* @return true if listener saved some data to string otherwise false
*/
- bool GetPolicyCertificateData(std::string& data) OVERRIDE;
+ bool GetPolicyCertificateData(std::string& data) const OVERRIDE;
/**
- * \brief Notification about protection result
- * \param connection_key Unique key of session which triggrs handshake
- * \param result result of connection protection
- * \return true on success notification handling or false otherwise
+ * @brief Notification about protection result
+ * @param connection_key Unique key of session which triggrs handshake
+ * @param result result of connection protection
+ * @return true on success notification handling or false otherwise
*/
bool OnHandshakeDone(
uint32_t connection_key,
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
index e9c7734189..055ff2cf45 100644
--- a/src/components/protocol_handler/src/handshake_handler.cc
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -78,7 +78,7 @@ HandshakeHandler::HandshakeHandler(
, payload_(payload) {}
HandshakeHandler::~HandshakeHandler() {
- LOG4CXX_DEBUG(logger_, "Destroying StartSessionHandler: " << this);
+ LOG4CXX_DEBUG(logger_, "Destroying of HandshakeHandler: " << this);
}
uint32_t HandshakeHandler::connection_key() const {
@@ -86,7 +86,7 @@ uint32_t HandshakeHandler::connection_key() const {
context_.new_session_id_);
}
-bool HandshakeHandler::GetPolicyCertificateData(std::string& data) {
+bool HandshakeHandler::GetPolicyCertificateData(std::string& data) const {
return false;
}
@@ -98,7 +98,12 @@ bool HandshakeHandler::OnHandshakeDone(
LOG4CXX_AUTO_TRACE(logger_);
if (connection_key != this->connection_key()) {
- LOG4CXX_DEBUG(logger_, "Notification not for handler " << this);
+ LOG4CXX_DEBUG(logger_,
+ "Listener " << this
+ << " expects notification for connection id: "
+ << this->connection_key()
+ << ". Received notification for connection id "
+ << connection_key << " will be ignored");
return false;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index c4a2253108..e7ff8d2f2d 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -1582,7 +1582,7 @@ void ProtocolHandlerImpl::NotifySessionStarted(
ptu_pending_handlers_.push_back(handler);
is_ptu_triggered_ = true;
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ security_manager_->NotifyOnCertificateUpdateRequired();
} else {
LOG4CXX_DEBUG(logger_, "PTU has been triggered. Added to pending.");
ptu_pending_handlers_.push_back(handler);