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

dont re-allocate sigv4a signer each request #3121

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ namespace Aws
mutable Utils::Threading::ReaderWriterLock m_partialSignatureLock;
PayloadSigningPolicy m_payloadSigningPolicy;
bool m_urlEscapePath;
mutable Aws::Crt::Auth::Sigv4HttpRequestSigner m_crtSigner{};
};
} // namespace Client
} // namespace Aws
Expand Down
4 changes: 1 addition & 3 deletions src/aws-cpp-sdk-core/source/auth/signer/AWSAuthV4Signer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ bool AWSAuthV4Signer::SignRequestWithSigV4a(Aws::Http::HttpRequest& request, con
awsSigningConfig.SetCredentials(crtCredentials);

std::shared_ptr<Aws::Crt::Http::HttpRequest> crtHttpRequest = request.ToCrtHttpRequest();

auto sigv4HttpRequestSigner = Aws::MakeShared<Aws::Crt::Auth::Sigv4HttpRequestSigner>(v4AsymmetricLogTag);
bool success = true;
sigv4HttpRequestSigner->SignRequest(crtHttpRequest, awsSigningConfig,
m_crtSigner.SignRequest(crtHttpRequest, awsSigningConfig,
[&request, &success, signatureType](const std::shared_ptr<Aws::Crt::Http::HttpRequest>& signedCrtHttpRequest, int errorCode) {
success = (errorCode == AWS_ERROR_SUCCESS);
if (success)
Expand Down
Loading