-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
close #8274
- Loading branch information
1 parent
a2878c0
commit aced292
Showing
30 changed files
with
384 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule aws
updated
26380 files
Submodule aws-c-auth
updated
49 files
Submodule aws-c-cal
updated
51 files
Submodule aws-c-common
updated
135 files
Submodule aws-c-compression
updated
3 files
+16 −5 | .github/workflows/ci.yml | |
+7 −0 | include/aws/compression/compression.h | |
+3 −0 | include/aws/compression/huffman.h |
Submodule aws-c-event-stream
updated
18 files
Submodule aws-c-http
updated
56 files
Submodule aws-c-io
updated
78 files
Submodule aws-c-mqtt
updated
73 files
Submodule aws-c-s3
updated
78 files
Submodule aws-c-sdkutils
updated
17 files
Submodule aws-checksums
updated
11 files
+82 −0 | .github/ISSUE_TEMPLATE/bug-report.yml | |
+5 −0 | .github/ISSUE_TEMPLATE/config.yml | |
+23 −0 | .github/ISSUE_TEMPLATE/documentation.yml | |
+47 −0 | .github/ISSUE_TEMPLATE/feature-request.yml | |
+9 −9 | .github/workflows/ci.yml | |
+17 −0 | .github/workflows/closed-issue-message.yml | |
+46 −0 | .github/workflows/stale_issue.yml | |
+66 −1 | .gitignore | |
+11 −10 | CMakeLists.txt | |
+5 −6 | include/aws/checksums/crc.h | |
+21 −19 | source/intel/asm/crc32c_sse42_asm.c |
101 changes: 101 additions & 0 deletions
101
contrib/aws-cmake/0001-More-reliable-way-to-check-if-there-is-anything-in-r.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
From 92225a50ccbab5369fd40b99a310ef7fcaec1750 Mon Sep 17 00:00:00 2001 | ||
From: JaySon-Huang <[email protected]> | ||
Date: Thu, 6 Apr 2023 12:54:23 +0800 | ||
Subject: [PATCH 1/2] More reliable way to check if there is anything in result | ||
IOStream | ||
|
||
Signed-off-by: JaySon-Huang <[email protected]> | ||
--- | ||
src/aws-cpp-sdk-core/source/client/AWSJsonClient.cpp | 9 +++++---- | ||
src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | 6 +++--- | ||
.../source/internal/AWSHttpResourceClient.cpp | 2 +- | ||
3 files changed, 9 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/src/aws-cpp-sdk-core/source/client/AWSJsonClient.cpp b/src/aws-cpp-sdk-core/source/client/AWSJsonClient.cpp | ||
index f42a306156..3cd26203f0 100644 | ||
--- a/src/aws-cpp-sdk-core/source/client/AWSJsonClient.cpp | ||
+++ b/src/aws-cpp-sdk-core/source/client/AWSJsonClient.cpp | ||
@@ -115,7 +115,8 @@ JsonOutcome AWSJsonClient::MakeRequest(const Aws::Http::URI& uri, | ||
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); | ||
} | ||
|
||
- if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0){ | ||
+ if (httpOutcome.GetResult()->GetResponseBody().peek() != std::char_traits<char>::eof()) | ||
+ { | ||
return smithy::components::tracing::TracingUtils::MakeCallWithTiming<JsonOutcome>( | ||
[&]() -> JsonOutcome { | ||
return JsonOutcome(AmazonWebServiceResult<JsonValue>(JsonValue(httpOutcome.GetResult()->GetResponseBody()), | ||
@@ -154,7 +155,7 @@ JsonOutcome AWSJsonClient::MakeRequest(const Aws::Http::URI& uri, | ||
{{TracingUtils::SMITHY_METHOD_DIMENSION, requestName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); | ||
} | ||
|
||
- if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0) | ||
+ if (httpOutcome.GetResult()->GetResponseBody().peek() != std::char_traits<char>::eof()) | ||
{ | ||
JsonValue jsonValue(httpOutcome.GetResult()->GetResponseBody()); | ||
if (!jsonValue.WasParseSuccessful()) { | ||
@@ -203,7 +204,7 @@ JsonOutcome AWSJsonClient::MakeEventStreamRequest(std::shared_ptr<Aws::Http::Htt | ||
|
||
HttpResponseOutcome httpOutcome(std::move(httpResponse)); | ||
|
||
- if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0) | ||
+ if (httpOutcome.GetResult()->GetResponseBody().peek() != std::char_traits<char>::eof()) | ||
{ | ||
JsonValue jsonValue(httpOutcome.GetResult()->GetResponseBody()); | ||
if (!jsonValue.WasParseSuccessful()) | ||
@@ -229,7 +230,7 @@ AWSError<CoreErrors> AWSJsonClient::BuildAWSError( | ||
bool retryable = httpResponse->GetClientErrorType() == CoreErrors::NETWORK_CONNECTION ? true : false; | ||
error = AWSError<CoreErrors>(httpResponse->GetClientErrorType(), "", httpResponse->GetClientErrorMessage(), retryable); | ||
} | ||
- else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().tellp() < 1) | ||
+ else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().peek() == std::char_traits<char>::eof()) | ||
{ | ||
auto responseCode = httpResponse->GetResponseCode(); | ||
auto errorCode = AWSClient::GuessBodylessErrorType(responseCode); | ||
diff --git a/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp b/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | ||
index 443ea31cbc..c122c5d5a1 100644 | ||
--- a/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | ||
+++ b/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | ||
@@ -110,7 +110,7 @@ XmlOutcome AWSXMLClient::MakeRequest(const Aws::Http::URI& uri, | ||
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); | ||
} | ||
|
||
- if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0) | ||
+ if (httpOutcome.GetResult()->GetResponseBody().peek() != std::char_traits<char>::eof()) | ||
{ | ||
return smithy::components::tracing::TracingUtils::MakeCallWithTiming<XmlOutcome>( | ||
[&]() -> XmlOutcome { | ||
@@ -152,7 +152,7 @@ XmlOutcome AWSXMLClient::MakeRequest(const Aws::Http::URI& uri, | ||
{{TracingUtils::SMITHY_METHOD_DIMENSION, requestName}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}}); | ||
} | ||
|
||
- if (httpOutcome.GetResult()->GetResponseBody().tellp() > 0) | ||
+ if (httpOutcome.GetResult()->GetResponseBody().peek() != std::char_traits<char>::eof()) | ||
{ | ||
return smithy::components::tracing::TracingUtils::MakeCallWithTiming<XmlOutcome>( | ||
[&]() -> XmlOutcome { | ||
@@ -182,7 +182,7 @@ AWSError<CoreErrors> AWSXMLClient::BuildAWSError(const std::shared_ptr<Http::Htt | ||
bool retryable = httpResponse->GetClientErrorType() == CoreErrors::NETWORK_CONNECTION ? true : false; | ||
error = AWSError<CoreErrors>(httpResponse->GetClientErrorType(), "", httpResponse->GetClientErrorMessage(), retryable); | ||
} | ||
- else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().tellp() < 1) | ||
+ else if (!httpResponse->GetResponseBody() || httpResponse->GetResponseBody().peek() == std::char_traits<char>::eof()) | ||
{ | ||
auto responseCode = httpResponse->GetResponseCode(); | ||
auto errorCode = AWSClient::GuessBodylessErrorType(responseCode); | ||
diff --git a/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp b/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp | ||
index 723747bbf1..8d84083ba3 100644 | ||
--- a/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp | ||
+++ b/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp | ||
@@ -148,7 +148,7 @@ namespace Aws | ||
AWS_LOGSTREAM_ERROR(m_logtag.c_str(), "Http request to retrieve credentials failed"); | ||
return AWSError<CoreErrors>(CoreErrors::NETWORK_CONNECTION, true); // Retryable | ||
} | ||
- else if (m_errorMarshaller && response->GetResponseBody().tellp() > 0) | ||
+ else if (m_errorMarshaller && response->GetResponseBody().peek() != std::char_traits<char>::eof()) | ||
{ | ||
return m_errorMarshaller->Marshall(*response); | ||
} | ||
-- | ||
2.31.1 | ||
|
62 changes: 62 additions & 0 deletions
62
contrib/aws-cmake/0002-Reduce-verbose-error-logging-and-404-for-HEAD-reques.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
From 7e6f90112f21c6996e097012c0fe6bfc5c3445d3 Mon Sep 17 00:00:00 2001 | ||
From: JaySon-Huang <[email protected]> | ||
Date: Wed, 17 May 2023 15:56:17 +0800 | ||
Subject: [PATCH 2/2] Reduce verbose error logging and 404 for HEAD request | ||
|
||
--- | ||
src/aws-cpp-sdk-core/source/client/AWSClient.cpp | 2 +- | ||
src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | 12 +++++++++++- | ||
2 files changed, 12 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/aws-cpp-sdk-core/source/client/AWSClient.cpp b/src/aws-cpp-sdk-core/source/client/AWSClient.cpp | ||
index 5d8a7a9e8a..932bf7d2c0 100644 | ||
--- a/src/aws-cpp-sdk-core/source/client/AWSClient.cpp | ||
+++ b/src/aws-cpp-sdk-core/source/client/AWSClient.cpp | ||
@@ -209,7 +209,6 @@ bool AWSClient::AdjustClockSkew(HttpResponseOutcome& outcome, const char* signer | ||
{ | ||
auto signer = GetSignerByName(signerName); | ||
//detect clock skew and try to correct. | ||
- AWS_LOGSTREAM_WARN(AWS_CLIENT_LOG_TAG, "If the signature check failed. This could be because of a time skew. Attempting to adjust the signer."); | ||
|
||
DateTime serverTime = GetServerTimeFromError(outcome.GetError()); | ||
const auto signingTimestamp = signer->GetSigningTimestamp(); | ||
@@ -224,6 +223,7 @@ bool AWSClient::AdjustClockSkew(HttpResponseOutcome& outcome, const char* signer | ||
//only try again if clock skew was the cause of the error. | ||
if (diff >= TIME_DIFF_MAX || diff <= TIME_DIFF_MIN) | ||
{ | ||
+ AWS_LOGSTREAM_WARN(AWS_CLIENT_LOG_TAG, "If the signature check failed. This could be because of a time skew. Attempting to adjust the signer."); | ||
diff = DateTime::Diff(serverTime, DateTime::Now()); | ||
AWS_LOGSTREAM_INFO(AWS_CLIENT_LOG_TAG, "Computed time difference as " << diff.count() << " milliseconds. Adjusting signer with the skew."); | ||
signer->SetClockSkew(diff); | ||
diff --git a/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp b/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | ||
index c122c5d5a1..311b64f4c0 100644 | ||
--- a/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | ||
+++ b/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp | ||
@@ -13,6 +13,7 @@ | ||
#include <aws/core/client/RetryStrategy.h> | ||
#include <aws/core/http/HttpClient.h> | ||
#include <aws/core/http/HttpResponse.h> | ||
+#include <aws/core/http/HttpTypes.h> | ||
#include <aws/core/http/URI.h> | ||
#include <aws/core/utils/Outcome.h> | ||
#include <aws/core/utils/xml/XmlSerializer.h> | ||
@@ -207,6 +208,15 @@ AWSError<CoreErrors> AWSXMLClient::BuildAWSError(const std::shared_ptr<Http::Htt | ||
error.SetResponseHeaders(httpResponse->GetHeaders()); | ||
error.SetResponseCode(httpResponse->GetResponseCode()); | ||
error.SetRemoteHostIpAddress(httpResponse->GetOriginatingRequest().GetResolvedRemoteHost()); | ||
- AWS_LOGSTREAM_ERROR(AWS_XML_CLIENT_LOG_TAG, error); | ||
+ | ||
+ if (httpResponse->GetOriginatingRequest().GetMethod() == HttpMethod::HTTP_HEAD && httpResponse->GetResponseCode() == HttpResponseCode::NOT_FOUND) | ||
+ { | ||
+ // ignore error logging for HEAD request with 404 response code, ususally it is caused by determining whether the object exists or not. | ||
+ AWS_LOGSTREAM_DEBUG(AWS_XML_CLIENT_LOG_TAG, error); | ||
+ } | ||
+ else | ||
+ { | ||
+ AWS_LOGSTREAM_ERROR(AWS_XML_CLIENT_LOG_TAG, error); | ||
+ } | ||
return error; | ||
} | ||
-- | ||
2.31.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule aws-crt-cpp
updated
84 files
Submodule aws-s2n-tls
updated
708 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.