diff --git a/source/main.cpp b/source/main.cpp index 6fa06f07..e78ec576 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -180,7 +180,8 @@ void attemptConnection() try { Retry::ExponentialRetryConfig retryConfig = {10 * 1000, 900 * 1000, -1, nullptr}; - auto publishLambda = []() -> bool { + auto publishLambda = []() -> bool + { int connectionStatus = resourceManager.get()->establishConnection(config.config); if (SharedCrtResourceManager::ABORT == connectionStatus) { @@ -202,8 +203,8 @@ void attemptConnection() return false; } }; - std::thread attemptConnectionThread( - [retryConfig, publishLambda] { Retry::exponentialBackoff(retryConfig, publishLambda); }); + std::thread attemptConnectionThread([retryConfig, publishLambda] + { Retry::exponentialBackoff(retryConfig, publishLambda); }); attemptConnectionThread.join(); } catch (const std::exception &e) @@ -237,10 +238,10 @@ namespace Aws case ClientBaseEventNotification::FEATURE_STOPPED: { LOGM_INFO(TAG, "%s has stopped", feature->getName().c_str()); - // Stopping DC for ST component - #if defined(DISABLE_MQTT) +// Stopping DC for ST component +#if defined(DISABLE_MQTT) shutdown(); - #endif +#endif break; } default: diff --git a/source/tunneling/SecureTunnelingFeature.cpp b/source/tunneling/SecureTunnelingFeature.cpp index 9e65ee57..ca921225 100644 --- a/source/tunneling/SecureTunnelingFeature.cpp +++ b/source/tunneling/SecureTunnelingFeature.cpp @@ -272,15 +272,15 @@ namespace Aws void SecureTunnelingFeature::OnConnectionShutdown(SecureTunnelingContext *contextToRemove) { LOG_DEBUG(TAG, "SecureTunnelingFeature::OnConnectionShutdown"); - #if defined(DISABLE_MQTT) +#if defined(DISABLE_MQTT) this->stop(); - #else - auto it = - find_if(mContexts.begin(), mContexts.end(), [&](const unique_ptr &c) { - return c.get() == contextToRemove; - }); +#else + auto it = find_if( + mContexts.begin(), + mContexts.end(), + [&](const unique_ptr &c) { return c.get() == contextToRemove; }); mContexts.erase(std::remove(mContexts.begin(), mContexts.end(), *it)); - #endif +#endif } } // namespace SecureTunneling