Skip to content
Closed
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
8 changes: 4 additions & 4 deletions prefetch_crt_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
# SPDX-License-Identifier: Apache-2.0.

CRT_URI_PREFIX=https://codeload.github.com/awslabs
CRT_URI=${CRT_URI_PREFIX}/aws-crt-cpp/zip/25a2e61972f5a0d517c6dc62533fdc7d7bd122a1 # v0.37.4
CRT_URI=${CRT_URI_PREFIX}/aws-crt-cpp/zip/2705dbd13811d584dc03beb17567bd7fc1fa7069 # v0.38.4

AWS_C_AUTH_URI=${CRT_URI_PREFIX}/aws-c-auth/zip/fc4b87655e5cd3921f18d1859193c74af4102071 # v0.10.1
AWS_C_CAL_URI=${CRT_URI_PREFIX}/aws-c-cal/zip/1cb9412158890201a6ffceed779f90fe1f48180c # v0.9.13
AWS_C_COMMON_URI=${CRT_URI_PREFIX}/aws-c-common/zip/95515a8b1ff40d5bb14f965ca4cbbe99ad1843df # v0.12.6
AWS_C_COMPRESSION_URI=${CRT_URI_PREFIX}/aws-c-compression/zip/d8264e64f698341eb03039b96b4f44702a9b3f83 # v0.3.2
AWS_C_EVENT_STREAM_URI=${CRT_URI_PREFIX}/aws-c-event-stream/zip/c741f95e9050a1a4bed4b3aa7543bd3e024f6e56 # v0.6.0
AWS_C_HTTP_URI=${CRT_URI_PREFIX}/aws-c-http/zip/0d8e1a933f46b8af984dfc8168ebcdf32748c184 # v0.10.11
AWS_C_EVENT_STREAM_URI=${CRT_URI_PREFIX}/aws-c-event-stream/zip/66cafb1d8bb1bfeb62a7601ce03d1a6fcd4798ed # v0.6.1
AWS_C_HTTP_URI=${CRT_URI_PREFIX}/aws-c-http/zip/da535b1bf9c9334730eb78a26a1bbb3c069b38c9 # v0.10.14
AWS_C_IO_URI=${CRT_URI_PREFIX}/aws-c-io/zip/bfb0819d3906502483611ce832a5ec6b897c8421 # v0.26.1
AWS_C_MQTT_URI=${CRT_URI_PREFIX}/aws-c-mqtt/zip/41b6a7d6d566a56eff69743df66c077d56a80c9d # v0.14.0
AWS_C_S3_URI=${CRT_URI_PREFIX}/aws-c-s3/zip/e9d1bde139f88b08aaa3bf0507f443f31ccede93 # v0.11.5
AWS_C_S3_URI=${CRT_URI_PREFIX}/aws-c-s3/zip/ab764f57ec3cab7866c0f8b7d9e9772b7cc1b9ee # v0.12.2
AWS_C_SDKUTILS_URI=${CRT_URI_PREFIX}/aws-c-sdkutils/zip/f678bda9e21f7217e4bbf35e0d1ea59540687933 # v0.2.4
AWS_CHECKSUMS_URI=${CRT_URI_PREFIX}/aws-checksums/zip/1d5f2f1f3e5d013aae8810878ceb5b3f6f258c4e # v0.2.10
AWS_LC_URI=${CRT_URI_PREFIX}/aws-lc/zip/37d86461a95782fd5d8b77873f9e1cb134ea2f95 # v1.69.0
Expand Down
1 change: 1 addition & 0 deletions src/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace Aws
REQUEST_TIMEOUT = 24,
NOT_INITIALIZED = 25,
MEMORY_ALLOCATION = 26,
NOT_IMPLEMENTED = 27,

NETWORK_CONNECTION = 99, // General failure to send message to service

Expand Down
17 changes: 15 additions & 2 deletions src/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
#pragma once

#include <aws/core/Core_EXPORTS.h>
#include <aws/core/http/HttpConnection.h>
#include <aws/core/utils/Outcome.h>
#include <aws/core/client/AWSError.h>

#include <memory>
#include <atomic>
#include <mutex>
#include <condition_variable>
#include <memory>
#include <mutex>

namespace Aws
{
Expand Down Expand Up @@ -77,6 +80,16 @@ namespace Aws
return !m_bad;
}

using AcquireConnectionOutcome = Aws::Utils::Outcome<std::shared_ptr<Aws::Http::Connection>,
Aws::Client::AWSError<Aws::Client::CoreErrors>>;
virtual AcquireConnectionOutcome AcquireConnection(const std::shared_ptr<HttpRequest>& request) {
AWS_UNREFERENCED_PARAM(request);
return Aws::Client::AWSError<Aws::Client::CoreErrors>{Aws::Client::CoreErrors::NOT_IMPLEMENTED,
"NotImplemented",
"creating a connection is not supported on this http client",
false};
}

protected:
bool m_bad;

Expand Down
20 changes: 20 additions & 0 deletions src/aws-cpp-sdk-core/include/aws/core/http/HttpClientStream.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>

namespace Aws {
namespace Http {
class HttpResponse;
class ClientStream {
public:
virtual ~ClientStream() = default;
virtual bool Activate() = 0;
virtual int WriteData(std::shared_ptr<Aws::IOStream> stream, bool endStream = false) = 0;
virtual std::shared_ptr<Aws::Http::HttpResponse> GetResponse() const = 0;
};
}
} // namespace Aws
22 changes: 22 additions & 0 deletions src/aws-cpp-sdk-core/include/aws/core/http/HttpConnection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/core/http/HttpClientStream.h>

#include <memory>

namespace Aws {
namespace Http {
class HttpRequest;
class Connection {
public:
virtual ~Connection() = default;
virtual std::shared_ptr<Aws::Http::ClientStream> NewClientStream(
const std::shared_ptr<HttpRequest>& request,
std::function<void ()> onStreamComplete) = 0;
};
} // namespace Http
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ namespace Aws

bool IsDefaultAwsHttpClient() const override { return true; }

private:
AcquireConnectionOutcome AcquireConnection(const std::shared_ptr<HttpRequest>& request) override;

private:
// Yeah, I know, but someone made MakeRequest() const and didn't think about the fact that
// making an HTTP request most certainly mutates state. It was me. I'm the person that did that, and
// now we're stuck with it. Thanks me.
Expand Down
Loading
Loading