summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kutsan (GitHub) <akutsan@luxoft.com>2016-12-02 17:25:09 +0200
committerGitHub <noreply@github.com>2016-12-02 17:25:09 +0200
commit6609f5d462677254e26611f84d73747cf6d9d02d (patch)
treefdabf304ecc3ea3aeb0810f6aba29ad0f1939fc7
parentde12196b26ba3f90ee6d569e12450203520cf302 (diff)
parent3c29d9c255a17ab211f89acfa38f0096243d2430 (diff)
downloadsdl_core-6609f5d462677254e26611f84d73747cf6d9d02d.tar.gz
Merge pull request #1090 from dcherniev/fix/undo_changes_of_fix_ut_failure
Revert "Merge pull request #1067 from dcherniev/fix/Fix_UT_failure"
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc2
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc2
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc1
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc8
-rw-r--r--src/components/utils/src/push_log.cc10
5 files changed, 8 insertions, 15 deletions
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
index 8b31ca8145..bb27493701 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -59,8 +59,6 @@ TransportAdapter::Error BluetoothConnectionFactory::CreateConnection(
<< ", app_handle: " << &app_handle);
BluetoothSocketConnection* connection(
new BluetoothSocketConnection(device_uid, app_handle, controller_));
- controller_->ConnectionCreated(connection, device_uid, app_handle);
-
TransportAdapter::Error error = connection->Start();
if (TransportAdapter::OK != error) {
LOG4CXX_ERROR(logger_, "connection::Start() failed");
diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
index 8a0751417f..5b1e9af6cb 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -57,8 +57,6 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection(
TcpServerOiginatedSocketConnection* connection(
new TcpServerOiginatedSocketConnection(
device_uid, app_handle, controller_));
- controller_->ConnectionCreated(connection, device_uid, app_handle);
-
if (connection->Start() == TransportAdapter::OK) {
LOG4CXX_DEBUG(logger_, "TCP connection initialised");
return TransportAdapter::OK;
diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
index 63cfb3ea51..5e9f3d941d 100644
--- a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
+++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
@@ -162,6 +162,7 @@ TransportAdapter::Error ThreadedSocketConnection::Disconnect() {
void ThreadedSocketConnection::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
+ controller_->ConnectionCreated(this, device_handle(), application_handle());
ConnectError* connect_error = NULL;
if (!Establish(&connect_error)) {
LOG4CXX_ERROR(logger_, "Connection Establish failed");
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
index f1c047fe58..f0fddfb4f5 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -281,11 +281,9 @@ TransportAdapter::Error TransportAdapterImpl::DisconnectDevice(
j != to_disconnect.end();
++j) {
ConnectionInfo info = *j;
- if (info.connection) {
- if (OK != info.connection->Disconnect()) {
- error = FAIL;
- LOG4CXX_ERROR(logger_, "Error on disconnect " << error);
- }
+ if (OK != info.connection->Disconnect()) {
+ error = FAIL;
+ LOG4CXX_ERROR(logger_, "Error on disconnect " << error);
}
}
diff --git a/src/components/utils/src/push_log.cc b/src/components/utils/src/push_log.cc
index 9644843c47..6e16c99181 100644
--- a/src/components/utils/src/push_log.cc
+++ b/src/components/utils/src/push_log.cc
@@ -92,13 +92,11 @@ void delete_log_message_loop_thread() {
}
void flush_logger() {
+ logger::LoggerStatus old_status = logger::logger_status;
// Stop pushing new messages to the log queue
- if (logger::logger_status != LoggerThreadNotCreated) {
- logger::LoggerStatus old_status = logger::logger_status;
- logger::logger_status = logger::DeletingLoggerThread;
- log_message_loop_thread->WaitDumpQueue();
- logger::logger_status = old_status;
- }
+ logger::logger_status = logger::DeletingLoggerThread;
+ log_message_loop_thread->WaitDumpQueue();
+ logger::logger_status = old_status;
}
} // namespace logger