Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated SDK commit to use the latest SDK code #416

Merged
merged 36 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
61d5485
Updated SDK commit to use the latest SDK code
HarshGandhi-AWS Jun 12, 2023
50b1f21
Addressed reviewers comments and updated unit tests to support the ch…
HarshGandhi-AWS Jun 19, 2023
1516023
Resolved indentation errors
HarshGandhi-AWS Jun 20, 2023
09af0fb
Resolved indentation errors
HarshGandhi-AWS Jun 20, 2023
d196c07
Resolved indentation errors
HarshGandhi-AWS Jun 20, 2023
b4358ef
Resolved indentation errors
HarshGandhi-AWS Jun 20, 2023
866712c
Resolved indentation errors
HarshGandhi-AWS Jun 20, 2023
d0c2eb9
update device mqtt connection logic
HarshGandhi-AWS Jun 20, 2023
a90659d
removing DC initialization code to create multiple lock files
HarshGandhi-AWS Jun 20, 2023
730d839
addressed reviewers comments to resolve test failures
HarshGandhi-AWS Jun 27, 2023
3897903
resolved unit test failure
HarshGandhi-AWS Jun 27, 2023
8e1ce2c
remove MemoryTrace unit test
HarshGandhi-AWS Jun 27, 2023
4d4a60d
resolved Lint errors
HarshGandhi-AWS Jun 27, 2023
6eb723b
explicitly calling the code in SharedCrtManager to initialize allocat…
HarshGandhi-AWS Jul 5, 2023
926147b
addressed lint errors
HarshGandhi-AWS Jul 5, 2023
f9c50fe
addressed lint errors
HarshGandhi-AWS Jul 5, 2023
0597270
addressed reviewers comment and added the config serialization test back
HarshGandhi-AWS Jul 6, 2023
676882c
Update GTestMain.cpp to not cleanup resources after testing is completed
HarshGandhi-AWS Jul 13, 2023
f357df6
Update e2e-tests-ubutu-x86 test to skip secure tunneling test
HarshGandhi-AWS Jul 14, 2023
95db8c9
Compile device client binaries as Release build type (#422)
marcoemorais-aws Aug 3, 2023
f50db70
update sdk commit again
RogerZhongAWS Aug 7, 2023
129f662
Updated code to shutdown on tunnel close callback and updated zlib de…
HarshGandhi-AWS Sep 29, 2023
d0e773d
Updated Secure Tunneling close logic for Secure Tunneling Component (…
HarshGandhi-AWS Oct 3, 2023
6ee7ff9
Added null check before closing connection (#429)
HarshGandhi-AWS Oct 11, 2023
f207eaf
fixed bug to read SIGTERM signal when sent form kernal (#430)
HarshGandhi-AWS Oct 12, 2023
af69d33
Fix docker-build.sh (#423)
RogerZhongAWS Oct 12, 2023
2efead6
Updated google-test lib version to v1.12.0 (#431)
HarshGandhi-AWS Oct 14, 2023
b75dc3a
disabled jobs and secure tunneling if they are not compiled into bina…
HarshGandhi-AWS Nov 7, 2023
0f91380
Update Dockerfile OpenSSL version (#435)
RogerZhongAWS Nov 8, 2023
00f68ce
Removed number of slash validation for MQTT topics (#438)
HarshGandhi-AWS Nov 27, 2023
7f569e9
updated SDK again
HarshGandhi-AWS Dec 5, 2023
d11c527
conflict fix
HarshGandhi-AWS Dec 5, 2023
fb58d1f
add http proxy support for secure tunneling
RogerZhongAWS Dec 11, 2023
1beb832
cleanup http proxy changes
RogerZhongAWS Dec 12, 2023
2aff02a
fix format
RogerZhongAWS Dec 12, 2023
0a3172b
fix format
RogerZhongAWS Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/docker-images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM ${BASE_IMAGE} AS deploy
COPY . /root/aws-iot-device-client
RUN mkdir -p /root/aws-iot-device-client/build \
&& cd /root/aws-iot-device-client/build \
&& cmake .. \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& cmake --build . --target aws-iot-device-client

ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM amazonlinux:2.0.20230307.0 as base

ARG OPENSSL_VERSION=1.1.1n
ARG OPENSSL_VERSION=3.0.8

###############################################################################
# Install prereqs
Expand All @@ -22,7 +22,7 @@ RUN yum -y update \
&& rm -rf /var/cache/yum

###############################################################################
# Install OpenSSL 1.1.1
# Install OpenSSL 3.0.8
###############################################################################
WORKDIR /tmp
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
Expand All @@ -46,9 +46,9 @@ RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.24.4/cmake-3
# Clone and build Google Test
###############################################################################
WORKDIR /tmp
RUN curl -sSL https://github.com/google/googletest/archive/release-1.11.0.tar.gz -o release-1.11.0.tar.gz \
&& tar xf release-1.11.0.tar.gz \
&& cd googletest-release-1.11.0 \
RUN curl -sSL https://github.com/google/googletest/archive/release-1.12.0.tar.gz -o release-1.12.0.tar.gz \
&& tar xf release-1.12.0.tar.gz \
&& cd googletest-release-1.12.0 \
&& cmake -DBUILD_SHARED_LIBS=ON . \
&& make \
&& cp -a googletest/include/gtest /usr/include/ \
Expand Down Expand Up @@ -87,7 +87,7 @@ RUN mkdir sdk-cpp-workspace \
&& cd sdk-cpp-workspace \
&& git clone https://github.com/aws/aws-iot-device-sdk-cpp-v2.git \
&& cd aws-iot-device-sdk-cpp-v2 \
&& git checkout ac3ba3774b031dde1b988e698880d6064d53b9d9 \
&& git checkout 74c8b683ebe5b1cbf484f6acaa281f56aaa63948 \
&& git submodule update --init --recursive \
&& cd .. \
&& mkdir aws-iot-device-sdk-cpp-v2-build \
Expand Down Expand Up @@ -117,4 +117,4 @@ RUN mkdir -p /root/aws-iot-device-client/build \
&& cmake .. \
&& cmake --build . --target aws-iot-device-client

ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
14 changes: 7 additions & 7 deletions .github/docker-images/base-images/device-client/ubi8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#https://access.redhat.com/RegistryAuthentication
FROM registry.access.redhat.com/ubi8/ubi AS base

ARG OPENSSL_VERSION=1.1.1n
ARG OPENSSL_VERSION=3.0.8

###############################################################################
# Install prereqs
Expand Down Expand Up @@ -33,7 +33,7 @@ RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.10.0/cmake-3
&& make install

###############################################################################
# Install OpenSSL 1.1.1
# Install OpenSSL 3.0.8
###############################################################################
WORKDIR /tmp
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
Expand All @@ -59,9 +59,9 @@ RUN wget https://dist.opendnssec.org/source/softhsm-2.3.0.tar.gz \
# Clone and build Google Test
###############################################################################
WORKDIR /tmp
RUN curl -sSL https://github.com/google/googletest/archive/release-1.11.0.tar.gz -o release-1.11.0.tar.gz \
&& tar xf release-1.11.0.tar.gz \
&& cd googletest-release-1.11.0 \
RUN curl -sSL https://github.com/google/googletest/archive/release-1.12.0.tar.gz -o release-1.12.0.tar.gz \
&& tar xf release-1.12.0.tar.gz \
&& cd googletest-release-1.12.0 \
&& cmake -DBUILD_SHARED_LIBS=ON . \
&& make \
&& cp -a googletest/include/gtest /usr/include/ \
Expand Down Expand Up @@ -100,7 +100,7 @@ RUN mkdir sdk-cpp-workspace \
&& cd sdk-cpp-workspace \
&& git clone https://github.com/aws/aws-iot-device-sdk-cpp-v2.git \
&& cd aws-iot-device-sdk-cpp-v2 \
&& git checkout ac3ba3774b031dde1b988e698880d6064d53b9d9 \
&& git checkout 74c8b683ebe5b1cbf484f6acaa281f56aaa63948 \
&& git submodule update --init --recursive \
&& cd .. \
&& mkdir aws-iot-device-sdk-cpp-v2-build \
Expand Down Expand Up @@ -130,4 +130,4 @@ RUN mkdir -p /root/aws-iot-device-client/build \
&& cmake .. \
&& cmake --build . --target aws-iot-device-client

ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:18.04 AS base

ENV DEBIAN_FRONTEND=noninteractive

ARG OPENSSL_VERSION=1.1.1n
ARG OPENSSL_VERSION=3.0.8

###############################################################################
# Install prereqs
Expand All @@ -20,7 +20,7 @@ RUN apt-get update -qq \
&& apt-get clean

###############################################################################
# Install OpenSSL 1.1.1
# Install OpenSSL 3.0.8
###############################################################################
WORKDIR /tmp
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
Expand All @@ -46,9 +46,9 @@ RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.10.0/cmake-3
# Clone and build Google Test
###############################################################################
WORKDIR /tmp
RUN wget --ca-certificate=/etc/ssl/certs/ca-certificates.crt https://github.com/google/googletest/archive/release-1.11.0.tar.gz \
&& tar xf release-1.11.0.tar.gz \
&& cd googletest-release-1.11.0 \
RUN wget --ca-certificate=/etc/ssl/certs/ca-certificates.crt https://github.com/google/googletest/archive/release-1.12.0.tar.gz \
&& tar xf release-1.12.0.tar.gz \
&& cd googletest-release-1.12.0 \
&& cmake -DBUILD_SHARED_LIBS=ON . \
&& make \
&& cp -a googletest/include/gtest /usr/include/ \
Expand Down Expand Up @@ -86,7 +86,7 @@ RUN mkdir sdk-cpp-workspace \
&& cd sdk-cpp-workspace \
&& git clone https://github.com/aws/aws-iot-device-sdk-cpp-v2.git \
&& cd aws-iot-device-sdk-cpp-v2 \
&& git checkout ac3ba3774b031dde1b988e698880d6064d53b9d9 \
&& git checkout 74c8b683ebe5b1cbf484f6acaa281f56aaa63948 \
&& git submodule update --init --recursive \
&& cd .. \
&& mkdir aws-iot-device-sdk-cpp-v2-build \
Expand Down Expand Up @@ -116,4 +116,4 @@ RUN mkdir -p /root/aws-iot-device-client/build \
&& cmake .. \
&& cmake --build . --target aws-iot-device-client

ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
20 changes: 6 additions & 14 deletions .github/docker-images/integration-tests/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ 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 && \
cd /home/dependencies

RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz -O /tmp/boost.tar.gz && \
RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz -O /tmp/boost.tar.gz && \
tar xzvf /tmp/boost.tar.gz && \
cd boost_1_79_0 && \
cd boost_1_81_0 && \
./bootstrap.sh && \
./b2 install link=static && \
cd /home/dependencies
Expand All @@ -39,14 +39,6 @@ RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/p
make install && \
cd /home/dependencies

RUN git clone https://github.com/openssl/openssl.git && \
cd openssl && \
git checkout OpenSSL_1_1_1-stable && \
./config && \
make depend && \
make all && \
cd /home/dependencies

RUN git clone --branch v2.13.6 https://github.com/catchorg/Catch2.git && \
cd Catch2 && \
mkdir build && \
Expand All @@ -58,7 +50,7 @@ RUN git clone --branch v2.13.6 https://github.com/catchorg/Catch2.git && \

RUN git clone https://github.com/aws-samples/aws-iot-securetunneling-localproxy && \
cd aws-iot-securetunneling-localproxy && \
git checkout 851de4cc2b48861b835327d005000c7d0c81d11b && \
git checkout d3150e0ebc4ef022939deb1ab43de005254f5751 && \
mkdir build && \
cd build && \
cmake ../ && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ Public License instead of this License.

------

** Google Test 1.10.0; version 1.10.0 -- https://github.com/google/googletest/blob/v1.10.x/LICENSE
** Google Test 1.12.0; version 1.12.0 -- https://github.com/google/googletest/blob/v1.12.x/LICENSE
Copyright 2008, Google Inc.
All rights reserved.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ Public License instead of this License.

------

** Google Test 1.10.0; version 1.10.0 -- https://github.com/google/googletest/blob/v1.10.x/LICENSE
** Google Test 1.12.0; version 1.12.0 -- https://github.com/google/googletest/blob/v1.12.x/LICENSE
Copyright 2008, Google Inc.
All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ jobs:
DEVICE_KEY_SECRET: ${{ secrets.FP_DEVICE_KEY_SECRET }}
AMAZON_ROOT_CA: ${{ secrets.AMAZON_ROOT_CA }}
run: |
docker run -e AWS_ACCESS_KEY_ID="$(echo ${{ secrets.INTEG_USER_KEY_ID }})" -e AWS_SECRET_ACCESS_KEY="$(echo ${{ secrets.INTEG_USER_KEY_SECRET }})" -e IOT_ENDPOINT="$(echo $IOT_ENDPOINT)" -e CERTIFICATE="$(echo $CERTIFICATE)" -e DEVICE_KEY_SECRET="$(echo $DEVICE_KEY_SECRET)" -e AMAZON_ROOT_CA="$(echo $AMAZON_ROOT_CA)" -e THING_NAME=fleetprovisioning ${{ steps.build-test-runner.outputs.imageid }} --clean-up
docker run -e AWS_ACCESS_KEY_ID="$(echo ${{ secrets.INTEG_USER_KEY_ID }})" -e AWS_SECRET_ACCESS_KEY="$(echo ${{ secrets.INTEG_USER_KEY_SECRET }})" -e IOT_ENDPOINT="$(echo $IOT_ENDPOINT)" -e CERTIFICATE="$(echo $CERTIFICATE)" -e DEVICE_KEY_SECRET="$(echo $DEVICE_KEY_SECRET)" -e AMAZON_ROOT_CA="$(echo $AMAZON_ROOT_CA)" -e THING_NAME=fleetprovisioning ${{ steps.build-test-runner.outputs.imageid }} --skip-st --clean-up
e2e-tests-ubuntu-aarch64:
runs-on: ubuntu-latest
if: ${{ false }} # Disabled for now. aarch64 local proxy build takes too long
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt.awssdk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(aws-iot-device-sdk-cpp-v2-download NONE)
include(ExternalProject)
ExternalProject_Add(aws-iot-device-sdk-cpp-v2
GIT_REPOSITORY https://github.com/aws/aws-iot-device-sdk-cpp-v2.git
GIT_TAG ac3ba3774b031dde1b988e698880d6064d53b9d9
GIT_TAG 74c8b683ebe5b1cbf484f6acaa281f56aaa63948
SOURCE_DIR "${CMAKE_BINARY_DIR}/aws-iot-device-sdk-cpp-v2-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/aws-iot-device-sdk-cpp-v2-build"
CONFIGURE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt.gtest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(googletest-download NONE)
include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_TAG release-1.12.0
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The AWS IoT Device Client is currently compatible with x86_64, aarch64, armv7l,

* C++ 11 or higher
* [CMake](https://cmake.org/) 3.10+
* OpenSSL 1.1.1
* OpenSSL 3.0.0+
* [aws-iot-device-sdk-cpp-v2](https://github.com/aws/aws-iot-device-sdk-cpp-v2) commit hash located in `CMakeLists.txt.awssdk`

*Note:* The TLS stack, and the version of the SDK mentioned above is what our CI uses. You could potentially use a different TLS stack for example, we just don't actively test or support this.
Expand Down
2 changes: 1 addition & 1 deletion docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Defaults to ubuntu (18.04). Other options are amazonlinux and ubi8
os=${1:-"ubuntu"}

docker build . --file .github/docker-images/base-images/"$os"/Dockerfile
docker build . --file .github/docker-images/base-images/device-client/"$os"/Dockerfile
2 changes: 1 addition & 1 deletion integration-tests/CMakeLists.txt.gtest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(googletest-download NONE)
include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
GIT_TAG release-1.12.0
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/source/GTestMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool parseCliArgs(int argc, char **argv)
}
else if (currentArg == CLI_CLEAN_UP)
{
CLEAN_UP = true;
CLEAN_UP = false;
}
else
{
Expand Down Expand Up @@ -185,4 +185,4 @@ int main(int argc, char **argv)
printf("Tests Complete!\n");
Aws::ShutdownAPI(options);
return rc;
}
}
44 changes: 36 additions & 8 deletions source/SharedCrtResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,31 @@ bool SharedCrtResourceManager::initialize(
std::shared_ptr<Util::FeatureRegistry> featureRegistry)
{
features = featureRegistry;
initializeAllocator(config);
initialized = buildClient(config) == SharedCrtResourceManager::SUCCESS;
return initialized;
}

void SharedCrtResourceManager::loadMemTraceLevelFromEnvironment()
{
const char *memTraceLevelStr = std::getenv("AWS_CRT_MEMORY_TRACING");
if (memTraceLevelStr)
{
switch (atoi(memTraceLevelStr))
{
case AWS_MEMTRACE_BYTES:
LOG_DEBUG(Config::TAG, "Set AWS_CRT_MEMORY_TRACING=AWS_MEMTRACE_BYTES");
memTraceLevel = AWS_MEMTRACE_BYTES;
break;
case AWS_MEMTRACE_STACKS:
LOG_DEBUG(Config::TAG, "Set AWS_CRT_MEMORY_TRACING=AWS_MEMTRACE_STACKS");
memTraceLevel = AWS_MEMTRACE_STACKS;
break;
default:
break;
}
}
}

bool SharedCrtResourceManager::locateCredentials(const PlainConfig &config) const
{
struct stat fileInfo;
Expand Down Expand Up @@ -174,22 +194,24 @@ bool SharedCrtResourceManager::setupLogging(const PlainConfig &config) const
return true;
}

void SharedCrtResourceManager::initializeAllocator(const PlainConfig &config)
void SharedCrtResourceManager::initializeAllocator()
{
loadMemTraceLevelFromEnvironment();
allocator = aws_default_allocator();
HarshGandhi-AWS marked this conversation as resolved.
Show resolved Hide resolved
memTraceLevel = config.memTraceLevel;

if (memTraceLevel != AWS_MEMTRACE_NONE)
{
// If memTraceLevel == AWS_MEMTRACE_STACKS(2), then by default 8 frames per stack are used.
allocator = aws_mem_tracer_new(allocator, nullptr, memTraceLevel, 0);
}
}

int SharedCrtResourceManager::buildClient(const PlainConfig &config)
{
// We MUST declare an instance of the ApiHandle to perform global initialization
// of the SDK libraries
apiHandle = unique_ptr<ApiHandle>(new ApiHandle());
}

int SharedCrtResourceManager::buildClient(const PlainConfig &config)
{
if (config.logConfig.sdkLoggingEnabled)
{
if (!setupLogging(config))
Expand Down Expand Up @@ -318,12 +340,13 @@ int SharedCrtResourceManager::establishConnection(const PlainConfig &config)
{
proxyOptions.HostName = proxyConfig.proxyHost->c_str();
proxyOptions.Port = proxyConfig.proxyPort.value();
proxyOptions.ProxyConnectionType = Aws::Crt::Http::AwsHttpProxyConnectionType::Tunneling;

LOGM_INFO(
TAG,
"Attempting to establish MQTT connection with proxy: %s:%u",
proxyConfig.proxyHost->c_str(),
proxyConfig.proxyPort.value());
proxyOptions.HostName.c_str(),
proxyOptions.Port);

if (proxyConfig.httpProxyAuthEnabled)
{
Expand Down Expand Up @@ -516,6 +539,11 @@ Aws::Crt::Io::ClientBootstrap *SharedCrtResourceManager::getClientBootstrap()
void SharedCrtResourceManager::disconnect()
{
LOG_DEBUG(TAG, "Attempting to disconnect MQTT connection");
if (connection == NULL)
{
return;
}

if (connection->Disconnect())
{
if (connectionClosedPromise.get_future().wait_for(std::chrono::seconds(DEFAULT_WAIT_TIME_SECONDS)) ==
Expand Down
6 changes: 4 additions & 2 deletions source/SharedCrtResourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace Aws

int buildClient(const PlainConfig &config);

void initializeAllocator(const PlainConfig &config);
void loadMemTraceLevelFromEnvironment();

protected:
/**
Expand All @@ -58,7 +58,7 @@ namespace Aws
bool locateCredentials(const PlainConfig &config) const;

public:
SharedCrtResourceManager() = default;
SharedCrtResourceManager() {}

virtual ~SharedCrtResourceManager();

Expand All @@ -80,6 +80,8 @@ namespace Aws

bool initialize(const PlainConfig &config, std::shared_ptr<Util::FeatureRegistry> featureRegistry);

void initializeAllocator();

void initializeAWSHttpLib();

int establishConnection(const PlainConfig &config);
Expand Down
Loading
Loading