Skip to content

Commit eba05ff

Browse files
committed
dont re-allocate sigv4a signer each request
1 parent d91b82e commit eba05ff

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/aws-cpp-sdk-core/include/aws/core/auth/signer/AWSAuthV4Signer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ namespace Aws
221221
mutable Utils::Threading::ReaderWriterLock m_partialSignatureLock;
222222
PayloadSigningPolicy m_payloadSigningPolicy;
223223
bool m_urlEscapePath;
224+
mutable Aws::Crt::Auth::Sigv4HttpRequestSigner m_crtSigner{};
224225
};
225226
} // namespace Client
226227
} // namespace Aws

src/aws-cpp-sdk-core/source/auth/signer/AWSAuthV4Signer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,8 @@ bool AWSAuthV4Signer::SignRequestWithSigV4a(Aws::Http::HttpRequest& request, con
146146
awsSigningConfig.SetCredentials(crtCredentials);
147147

148148
std::shared_ptr<Aws::Crt::Http::HttpRequest> crtHttpRequest = request.ToCrtHttpRequest();
149-
150-
auto sigv4HttpRequestSigner = Aws::MakeShared<Aws::Crt::Auth::Sigv4HttpRequestSigner>(v4AsymmetricLogTag);
151149
bool success = true;
152-
sigv4HttpRequestSigner->SignRequest(crtHttpRequest, awsSigningConfig,
150+
m_crtSigner.SignRequest(crtHttpRequest, awsSigningConfig,
153151
[&request, &success, signatureType](const std::shared_ptr<Aws::Crt::Http::HttpRequest>& signedCrtHttpRequest, int errorCode) {
154152
success = (errorCode == AWS_ERROR_SUCCESS);
155153
if (success)

0 commit comments

Comments
 (0)