diff options
author | ShobhitAd <adlakhashobhit@gmail.com> | 2018-12-10 11:03:50 -0500 |
---|---|---|
committer | ShobhitAd <adlakhashobhit@gmail.com> | 2018-12-10 11:03:50 -0500 |
commit | fbb12b62313cd29dc9b0131b839c0d095a75794a (patch) | |
tree | 4b3f3ec6608b1e98d21074b486b2ab16f75687db | |
parent | 1b36f5f570516a13caa9f1baa230e365608ab121 (diff) | |
download | sdl_core-fbb12b62313cd29dc9b0131b839c0d095a75794a.tar.gz |
Remove extra debug statements
-rw-r--r-- | src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h | 3 | ||||
-rw-r--r-- | src/components/transport_manager/src/cloud/websocket_client_connection.cc | 45 |
2 files changed, 15 insertions, 33 deletions
diff --git a/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h b/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h index adbe17112c..4f6e2b02af 100644 --- a/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h +++ b/src/components/transport_manager/include/transport_manager/cloud/websocket_client_connection.h @@ -127,9 +127,8 @@ class WebsocketClientConnection * @brief Attempt to add provided certificate to the ssl::context * * @param cert Certificate string from policy table - * @return true if certificate was not invalid and was added successfully */ - bool AddCertificateAuthority(std::string cert, boost::system::error_code& ec); + void AddCertificateAuthority(std::string cert, boost::system::error_code& ec); void Shutdown(); diff --git a/src/components/transport_manager/src/cloud/websocket_client_connection.cc b/src/components/transport_manager/src/cloud/websocket_client_connection.cc index e6da3e9b6c..5da91871ad 100644 --- a/src/components/transport_manager/src/cloud/websocket_client_connection.cc +++ b/src/components/transport_manager/src/cloud/websocket_client_connection.cc @@ -53,9 +53,7 @@ WebsocketClientConnection::WebsocketClientConnection( , thread_delegate_(new LoopThreadDelegate(&message_queue_, this)) , write_thread_(threads::CreateThread("WS Async Send", thread_delegate_)) , device_uid_(device_uid) - , app_handle_(app_handle) { - LOG4CXX_DEBUG(logger_, "CLOUD_DEBUG_WEBSOCKETCLIENTCONNECTION"); -} + , app_handle_(app_handle) {} WebsocketClientConnection::~WebsocketClientConnection() { ioc_.stop(); @@ -64,22 +62,17 @@ WebsocketClientConnection::~WebsocketClientConnection() { } } -bool WebsocketClientConnection::AddCertificateAuthority( +void WebsocketClientConnection::AddCertificateAuthority( const std::string cert, boost::system::error_code& ec) { ctx_.add_certificate_authority(boost::asio::buffer(cert.data(), cert.size()), ec); if (ec) { - return false; + return; } boost::get<WSSptr>(dynamic_ws_) ->next_layer() .set_verify_mode(ssl::verify_peer); - if (ec) { - return false; - } - - return true; } TransportAdapter::Error WebsocketClientConnection::Start() { @@ -93,14 +86,18 @@ TransportAdapter::Error WebsocketClientConnection::Start() { auto const port = cloud_device->GetPort(); boost::system::error_code ec; - LOG4CXX_DEBUG(logger_, "CLOUD_CONN_START"); - LOG4CXX_DEBUG(logger_, "ENDPOINT: " << cloud_properties.endpoint); - LOG4CXX_DEBUG(logger_, "CERTIFICATE: " << cloud_properties.certificate); - LOG4CXX_DEBUG(logger_, "AUTH_TOKEN: " << cloud_properties.auth_token); + LOG4CXX_DEBUG(logger_, "Cloud app endpoint: " << cloud_properties.endpoint); LOG4CXX_DEBUG(logger_, - "TRANSPORT_TYPE: " << cloud_properties.cloud_transport_type); + "Cloud app certificate: " << cloud_properties.certificate); + LOG4CXX_DEBUG( + logger_, + "Cloud app authentication token: " << cloud_properties.auth_token); + LOG4CXX_DEBUG( + logger_, + "Cloud app transport type: " << cloud_properties.cloud_transport_type); LOG4CXX_DEBUG(logger_, - "HYBRID_APP_PREF: " << cloud_properties.hybrid_app_preference); + "Cloud app hybrid app preference: " + << cloud_properties.hybrid_app_preference); auto const results = resolver_.resolve(host, port, ec); if (ec) { @@ -110,8 +107,6 @@ TransportAdapter::Error WebsocketClientConnection::Start() { return TransportAdapter::FAIL; } - LOG4CXX_DEBUG(logger_, "CLOUD_CONN_RESOLVE"); - if (cloud_properties.cloud_transport_type == "WSS") { dynamic_ws_ = std::make_shared<WSS>(ioc_, ctx_); } else { @@ -140,16 +135,8 @@ TransportAdapter::Error WebsocketClientConnection::Start() { return TransportAdapter::FAIL; } - LOG4CXX_DEBUG(logger_, "CLOUD_CONN_TCP"); - if (cloud_properties.cloud_transport_type == "WSS") { - bool isAdded = AddCertificateAuthority(cloud_properties.certificate, ec); - - if (isAdded) { - LOG4CXX_INFO(logger_, "Certificate Authority added successfully"); - } else { - LOG4CXX_INFO(logger_, "Failed to add certificate authority"); - } + AddCertificateAuthority(cloud_properties.certificate, ec); if (ec) { std::string str_err = "ErrorMessage: " + ec.message(); @@ -175,8 +162,6 @@ TransportAdapter::Error WebsocketClientConnection::Start() { Shutdown(); return TransportAdapter::FAIL; } - - LOG4CXX_DEBUG(logger_, "CLOUD_CONN_SSL"); } // Perform websocket handshake @@ -195,8 +180,6 @@ TransportAdapter::Error WebsocketClientConnection::Start() { return TransportAdapter::FAIL; } - LOG4CXX_DEBUG(logger_, "CLOUD_CONN_WEBSOCKET"); - // Set the binary message write option if (cloud_properties.cloud_transport_type == "WSS") { boost::get<WSSptr>(dynamic_ws_)->binary(true); |