Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerZhongAWS committed Dec 12, 2023
1 parent 1beb832 commit 2aff02a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
32 changes: 16 additions & 16 deletions source/tunneling/SecureTunnelWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ SecureTunnelWrapper::SecureTunnelWrapper(
const Aws::Iotsecuretunneling::OnStreamReset &onStreamReset,
const Aws::Iotsecuretunneling::OnSessionReset &onSessionReset)
: secureTunnel((Aws::Iotsecuretunneling::SecureTunnelBuilder(
allocator,
*bootstrap,
socketOptions,
accessToken,
localProxyMode,
endpoint))
.WithHttpClientConnectionProxyOptions(proxyOptions)
.WithRootCa(rootCa)
.WithOnConnectionComplete(onConnectionComplete)
.WithOnConnectionShutdown(onConnectionShutdown)
.WithOnSendDataComplete(onSendDataComplete)
.WithOnDataReceive(onDataReceive)
.WithOnStreamStart(onStreamStart)
.WithOnStreamReset(onSessionReset)
.WithOnSessionReset(onSessionReset)
.Build())
allocator,
*bootstrap,
socketOptions,
accessToken,
localProxyMode,
endpoint))
.WithHttpClientConnectionProxyOptions(proxyOptions)
.WithRootCa(rootCa)
.WithOnConnectionComplete(onConnectionComplete)
.WithOnConnectionShutdown(onConnectionShutdown)
.WithOnSendDataComplete(onSendDataComplete)
.WithOnDataReceive(onDataReceive)
.WithOnStreamStart(onStreamStart)
.WithOnStreamReset(onSessionReset)
.WithOnSessionReset(onSessionReset)
.Build())
{
}

Expand Down
12 changes: 7 additions & 5 deletions source/tunneling/SecureTunnelingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ namespace Aws
const string &endpoint,
const int port,
const OnConnectionShutdownFn &onConnectionShutdown)
: mSharedCrtResourceManager(manager), mProxyOptions(proxyOptions), mRootCa(rootCa.has_value() ? rootCa.value() : ""),
mAccessToken(accessToken), mEndpoint(endpoint), mPort(port),
mOnConnectionShutdown(onConnectionShutdown)
: mSharedCrtResourceManager(manager), mProxyOptions(proxyOptions),
mRootCa(rootCa.has_value() ? rootCa.value() : ""), mAccessToken(accessToken), mEndpoint(endpoint),
mPort(port), mOnConnectionShutdown(onConnectionShutdown)
{
}

Expand Down Expand Up @@ -205,7 +205,8 @@ namespace Aws
const Aws::Iotsecuretunneling::OnStreamReset &onStreamReset,
const Aws::Iotsecuretunneling::OnSessionReset &onSessionReset)
{
if (mProxyOptions.HostName.length() > 0) {
if (mProxyOptions.HostName.length() > 0)
{
LOGM_INFO(TAG, "Creating Secure Tunneling with proxy to: %s", mProxyOptions.HostName.c_str());
return std::make_shared<SecureTunnelWrapper>(
mSharedCrtResourceManager->getAllocator(),
Expand All @@ -224,7 +225,8 @@ namespace Aws
onStreamReset,
onSessionReset);
}
else {
else
{
return std::make_shared<SecureTunnelWrapper>(
mSharedCrtResourceManager->getAllocator(),
mSharedCrtResourceManager->getClientBootstrap(),
Expand Down
4 changes: 2 additions & 2 deletions source/tunneling/SecureTunnelingFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ namespace Aws

void SecureTunnelingFeature::LoadFromConfig(const PlainConfig &config)
{
// Aws::Crt::Http::HttpClientConnectionProxyOptions proxyOptions;
PlainConfig::HttpProxyConfig proxyConfig = config.httpProxyConfig;

if (proxyConfig.httpProxyEnabled)
Expand All @@ -118,7 +117,8 @@ namespace Aws
basicAuthConfig.Username = proxyConfig.proxyUsername->c_str();
basicAuthConfig.Password = proxyConfig.proxyPassword->c_str();
proxyOptions.ProxyStrategy =
Aws::Crt::Http::HttpProxyStrategy::CreateBasicHttpProxyStrategy(basicAuthConfig, Aws::Crt::g_allocator);
Aws::Crt::Http::HttpProxyStrategy::CreateBasicHttpProxyStrategy(
basicAuthConfig, Aws::Crt::g_allocator);
}
else
{
Expand Down

0 comments on commit 2aff02a

Please sign in to comment.