Skip to content

Commit

Permalink
Updated code to shutdown on tunnel close callback and updated zlib de…
Browse files Browse the repository at this point in the history
…pendency version(#426)

* updated code to shutdown on tunnel close callback

* addressed lint errors
  
* addressed lint errors

* addressed lint errors

* updated zlib version

* updated zlib version

* updated comment
  • Loading branch information
HarshGandhi-AWS authored Sep 29, 2023
1 parent 95db8c9 commit 129f662
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/docker-images/integration-tests/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ RUN apt update && apt upgrade -y && \
RUN mkdir /home/dependencies
WORKDIR /home/dependencies

RUN wget https://www.zlib.net/zlib-1.2.13.tar.gz -O /tmp/zlib-1.2.13.tar.gz && \
tar xzvf /tmp/zlib-1.2.13.tar.gz && \
cd zlib-1.2.13 && \
RUN wget https://www.zlib.net/zlib-1.3.tar.gz -O /tmp/zlib-1.3.tar.gz && \
tar xzvf /tmp/zlib-1.3.tar.gz && \
cd zlib-1.3 && \
./configure && \
make && \
make install && \
Expand Down
4 changes: 4 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ namespace Aws
case ClientBaseEventNotification::FEATURE_STOPPED:
{
LOGM_INFO(TAG, "%s has stopped", feature->getName().c_str());
// Stopping DC instance if secure tunnel is closed for a ST component
#if defined(DISABLE_MQTT)
shutdown();
#endif
break;
}
default:
Expand Down
5 changes: 4 additions & 1 deletion source/tunneling/SecureTunnelingFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,15 @@ namespace Aws
void SecureTunnelingFeature::OnConnectionShutdown(SecureTunnelingContext *contextToRemove)
{
LOG_DEBUG(TAG, "SecureTunnelingFeature::OnConnectionShutdown");

#if defined(DISABLE_MQTT)
this->stop();
#else
auto it =
find_if(mContexts.begin(), mContexts.end(), [&](const unique_ptr<SecureTunnelingContext> &c) {
return c.get() == contextToRemove;
});
mContexts.erase(std::remove(mContexts.begin(), mContexts.end(), *it));
#endif
}

} // namespace SecureTunneling
Expand Down

0 comments on commit 129f662

Please sign in to comment.