Skip to content

Commit

Permalink
Update CRT submodules
Browse files Browse the repository at this point in the history
We haven't done this since starting the project, and there's been a few
important fixes since then, most notably awslabs/aws-c-s3#226 for
detecting concurrent mutations during GETs.

On our bindings side not much has changed. The Uri code moved from
aws-c-io to aws-c-common, and there was also a change to how missing
path fragments are parsed in URIs (awslabs/aws-c-common#986).

Signed-off-by: James Bornholt <[email protected]>
  • Loading branch information
jamesbornholt committed Feb 18, 2023
1 parent 71f83ab commit a2dceaf
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-auth
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-cal
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-common
Submodule aws-c-common updated 71 files
+28 −5 .github/workflows/ci.yml
+3 −3 .github/workflows/clang-format.yml
+1 −1 .github/workflows/clang-tidy.yml
+25 −0 .github/workflows/codecov.yml
+2 −0 .gitignore
+0 −0 .gitmodules
+3 −0 CMakeLists.txt
+3 −2 builder.json
+32 −0 cmake/AwsCRuntime.cmake
+1 −0 cmake/AwsFeatureTests.cmake
+59 −0 cmake/AwsThreadName.cmake
+6 −0 include/aws/common/allocator.h
+13 −7 include/aws/common/assert.h
+1 −1 include/aws/common/bus.h
+19 −8 include/aws/common/byte_buf.h
+3 −3 include/aws/common/command_line_parser.h
+2 −2 include/aws/common/common.h
+34 −1 include/aws/common/encoding.h
+5 −1 include/aws/common/error.h
+4 −1 include/aws/common/file.h
+83 −3 include/aws/common/json.h
+1 −0 include/aws/common/linked_hash_table.h
+19 −3 include/aws/common/logging.h
+2 −2 include/aws/common/macros.h
+1 −1 include/aws/common/private/hash_table_impl.h
+16 −2 include/aws/common/thread.h
+162 −0 include/aws/common/uri.h
+8 −5 include/aws/testing/aws_test_harness.h
+99 −0 scripts/appverifier_ctest.py
+266 −0 scripts/appverifier_xml.py
+1 −1 source/allocator.c
+5 −0 source/allocator_sba.c
+2 −1 source/array_list.c
+1 −1 source/bus.c
+4 −6 source/command_line_parser.c
+13 −1 source/common.c
+1 −1 source/date_time.c
+117 −5 source/encoding.c
+4 −0 source/error.c
+17 −12 source/file.c
+104 −19 source/json.c
+23 −0 source/linked_hash_table.c
+18 −4 source/log_channel.c
+3 −2 source/log_writer.c
+18 −1 source/logging.c
+4 −4 source/memtrace.c
+63 −39 source/posix/file.c
+2 −2 source/posix/system_info.c
+75 −35 source/posix/thread.c
+6 −4 source/priority_queue.c
+596 −0 source/uri.c
+5 −3 source/uuid.c
+23 −5 source/windows/file.c
+4 −4 source/windows/system_info.c
+19 −3 source/windows/thread.c
+6 −6 source/xml_parser.c
+29 −0 tests/CMakeLists.txt
+36 −8 tests/alloc_test.c
+262 −0 tests/encoding_test.c
+131 −0 tests/json_test.c
+135 −0 tests/linked_hash_table_test.c
+6 −4 tests/logging/log_channel_test.c
+47 −0 tests/split_test.c
+3 −0 tests/thread_test.c
+887 −0 tests/uri_test.c
+3 −0 tests/zero_test.c
+1 −1 verification/cbmc/proofs/aws_priority_queue_s_sift_down/aws_priority_queue_s_sift_down_harness.c
+1 −1 verification/cbmc/proofs/aws_priority_queue_s_sift_up/aws_priority_queue_s_sift_up_harness.c
+1 −0 verification/cbmc/stubs/memset_override_0.c
+4 −0 verification/cbmc/stubs/s_expand_table_override.c
+1 −3 verification/cbmc/stubs/s_sift_either_override.c
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-compression
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-http
Submodule aws-c-http updated 54 files
+2 −0 .builder/action/aws-c-http-test.py
+46 −0 .builder/action/local-server-setup.py
+27 −23 .github/workflows/ci.yml
+1 −0 .gitignore
+7 −2 bin/elasticurl/main.c
+3 −1 builder.json
+3 −3 codebuild/linux-integration-tests.yml
+10 −3 include/aws/http/connection.h
+4 −2 include/aws/http/connection_manager.h
+1 −0 include/aws/http/http.h
+2 −2 include/aws/http/http2_stream_manager.h
+7 −1 include/aws/http/private/proxy_impl.h
+1 −0 include/aws/http/private/request_response_impl.h
+11 −2 include/aws/http/private/websocket_decoder.h
+1 −0 include/aws/http/private/websocket_impl.h
+36 −5 include/aws/http/request_response.h
+91 −50 include/aws/http/websocket.h
+2 −2 integration-testing/http_client_test.py
+25 −17 source/connection.c
+3 −2 source/connection_manager.c
+1 −39 source/h1_decoder.c
+7 −3 source/h1_stream.c
+2 −2 source/h2_connection.c
+7 −7 source/h2_decoder.c
+8 −7 source/h2_stream.c
+1 −1 source/hpack_decoder.c
+2 −2 source/hpack_encoder.c
+3 −0 source/http.c
+12 −2 source/http2_stream_manager.c
+108 −41 source/proxy_connection.c
+63 −7 source/request_response.c
+146 −111 source/websocket.c
+449 −136 source/websocket_bootstrap.c
+70 −15 source/websocket_decoder.c
+24 −3 source/websocket_encoder.c
+30 −6 tests/CMakeLists.txt
+1 −1 tests/fuzz/fuzz_h2_decoder_correct.c
+3 −0 tests/h2_test_helper.c
+4 −4 tests/py_localhost/README.md
+1 −1 tests/py_localhost/non_tls_server.py
+1 −1 tests/py_localhost/server.py
+9 −0 tests/stream_test_helper.c
+2 −0 tests/stream_test_helper.h
+65 −10 tests/test_connection.c
+73 −13 tests/test_connection_manager.c
+1 −5 tests/test_connection_monitor.c
+79 −0 tests/test_h1_client.c
+156 −2 tests/test_h2_client.c
+4 −8 tests/test_localhost_integ.c
+62 −1 tests/test_message.c
+38 −24 tests/test_stream_manager.c
+622 −97 tests/test_websocket_bootstrap.c
+220 −6 tests/test_websocket_decoder.c
+124 −94 tests/test_websocket_handler.c
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-io
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-s3
Submodule aws-c-s3 updated 58 files
+41 −0 .builder/actions/mock_server_setup.py
+8 −0 .github/.codecov.yml
+31 −9 .github/workflows/ci.yml
+28 −0 .github/workflows/codecov.yml
+3 −0 CMakeLists.txt
+5 −0 README.md
+2 −1 benchmarks/benchmarks-stack/benchmarks-stack/lib/init_instance.sh
+5 −1 builder.json
+6 −0 include/aws/s3/private/s3_auto_ranged_get.h
+13 −7 include/aws/s3/private/s3_auto_ranged_put.h
+30 −5 include/aws/s3/private/s3_checksums.h
+135 −27 include/aws/s3/private/s3_client_impl.h
+1 −3 include/aws/s3/private/s3_default_meta_request.h
+24 −12 include/aws/s3/private/s3_meta_request_impl.h
+5 −1 include/aws/s3/private/s3_request.h
+14 −4 include/aws/s3/private/s3_request_messages.h
+24 −2 include/aws/s3/private/s3_util.h
+2 −0 include/aws/s3/s3.h
+319 −48 include/aws/s3/s3_client.h
+1 −2 samples/s3/cli_progress_bar.c
+3 −1 source/s3.c
+105 −11 source/s3_auto_ranged_get.c
+254 −187 source/s3_auto_ranged_put.c
+16 −14 source/s3_checksum_stream.c
+40 −0 source/s3_checksums.c
+346 −83 source/s3_client.c
+9 −10 source/s3_copy_object.c
+13 −23 source/s3_default_meta_request.c
+109 −47 source/s3_endpoint.c
+172 −102 source/s3_meta_request.c
+30 −19 source/s3_paginator.c
+2 −13 source/s3_request.c
+144 −47 source/s3_request_messages.c
+55 −5 source/s3_util.c
+37 −12 tests/CMakeLists.txt
+6 −0 tests/mock_s3_server/AbortMultipartUpload/default.json
+14 −0 tests/mock_s3_server/CompleteMultipartUpload/async_access_denied_error.json
+14 −0 tests/mock_s3_server/CompleteMultipartUpload/async_internal_error.json
+13 −0 tests/mock_s3_server/CompleteMultipartUpload/default.json
+12 −0 tests/mock_s3_server/CreateMultipartUpload/default.json
+7 −0 tests/mock_s3_server/GetObject/get_object_modified_failure.json
+14 −0 tests/mock_s3_server/GetObject/get_object_modified_first_part.json
+10 −0 tests/mock_s3_server/GetObject/get_object_modified_success.json
+47 −0 tests/mock_s3_server/README.md
+6 −0 tests/mock_s3_server/UploadPart/default.json
+325 −0 tests/mock_s3_server/mock_s3_server.py
+13 −12 tests/s3_cancel_tests.c
+2 −2 tests/s3_checksum_stream_test.c
+749 −197 tests/s3_data_plane_tests.c
+4 −4 tests/s3_endpoint_tests.c
+188 −0 tests/s3_mock_server_tests.c
+2 −2 tests/s3_request_messages_tests.c
+13 −14 tests/s3_retry_tests.c
+145 −40 tests/s3_tester.c
+29 −4 tests/s3_tester.h
+52 −2 tests/s3_util_tests.c
+47 −0 tests/test_helper/README.md
+142 −0 tests/test_helper/test_helper.py
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-c-sdkutils
Submodule aws-c-sdkutils updated 55 files
+27 −5 .github/workflows/ci.yml
+4 −1 CMakeLists.txt
+1 −1 README.md
+3 −0 builder.json
+303 −0 include/aws/sdkutils/endpoints_rule_engine.h
+38 −0 include/aws/sdkutils/partitions.h
+314 −0 include/aws/sdkutils/private/endpoints_types_impl.h
+136 −0 include/aws/sdkutils/private/endpoints_util.h
+12 −0 include/aws/sdkutils/sdkutils.h
+1,132 −0 source/endpoints_rule_engine.c
+958 −0 source/endpoints_ruleset.c
+639 −0 source/endpoints_standard_lib.c
+235 −0 source/endpoints_types_impl.c
+588 −0 source/endpoints_util.c
+283 −0 source/partitions.c
+1 −1 source/resource_name.c
+11 −0 source/sdkutils.c
+27 −0 tests/CMakeLists.txt
+477 −0 tests/endpoints_rule_engine_tests.c
+181 −0 tests/endpoints_util_tests.c
+0 −7 tests/resource_name_tests.c
+101 −0 tests/resources/partitions.json
+45 −0 tests/resources/sample_partitions.json
+41 −0 tests/resources/sample_ruleset.json
+33 −0 tests/resources/test-cases/aws-region.json
+15 −0 tests/resources/test-cases/custom_object_condition.json
+45 −0 tests/resources/test-cases/default-values.json
+48 −0 tests/resources/test-cases/eventbridge.json
+50 −0 tests/resources/test-cases/fns.json
+25 −0 tests/resources/test-cases/headers.json
+148 −0 tests/resources/test-cases/is-virtual-hostable-s3-bucket.json
+27 −0 tests/resources/test-cases/local-region-override.json
+152 −0 tests/resources/test-cases/parse-arn.json
+153 −0 tests/resources/test-cases/parse-url.json
+125 −0 tests/resources/test-cases/partition-fn.json
+185 −0 tests/resources/test-cases/substring.json
+75 −0 tests/resources/test-cases/uri-encode.json
+56 −0 tests/resources/test-cases/valid-hostlabel.json
+44 −0 tests/resources/valid-rules/aws-region.json
+32 −0 tests/resources/valid-rules/custom_object_condition.json
+44 −0 tests/resources/valid-rules/default-values.json
+41 −0 tests/resources/valid-rules/deprecated-param.json
+323 −0 tests/resources/valid-rules/eventbridge.json
+128 −0 tests/resources/valid-rules/fns.json
+46 −0 tests/resources/valid-rules/get-attr-type-inference.json
+44 −0 tests/resources/valid-rules/headers.json
+48 −0 tests/resources/valid-rules/is-virtual-hostable-s3-bucket.json
+29 −0 tests/resources/valid-rules/minimal-ruleset.json
+251 −0 tests/resources/valid-rules/parse-arn.json
+102 −0 tests/resources/valid-rules/parse-url.json
+101 −0 tests/resources/valid-rules/partition-fn.json
+36 −0 tests/resources/valid-rules/region-override.json
+95 −0 tests/resources/valid-rules/substring.json
+44 −0 tests/resources/valid-rules/uri-encode.json
+55 −0 tests/resources/valid-rules/valid-hostlabel.json
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-checksums
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/aws-lc
2 changes: 1 addition & 1 deletion aws-crt-s3-sys/crt/s2n-tls
Submodule s2n-tls updated 803 files
1 change: 1 addition & 0 deletions aws-crt-s3/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mod logging;
pub mod ref_count;
pub mod rust_log_adapter;
pub mod task_scheduler;
pub mod uri;

static COMMON_LIBRARY_INIT: Once = Once::new();

Expand Down
3 changes: 1 addition & 2 deletions aws-crt-s3/src/io/uri.rs → aws-crt-s3/src/common/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ impl Uri {
}
}

/// Return the path portion of the URI, including the leading "/". If no path was present,
/// returns "/".
/// Return the path portion of the URI, including any leading "/".
pub fn path(&self) -> &OsStr {
// SAFETY: `inner` is a valid `aws_uri` since it's owned by this struct, and the lifetime of
// the returned slice will be tied to &self.
Expand Down
1 change: 0 additions & 1 deletion aws-crt-s3/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub mod futures;
pub mod host_resolver;
pub mod retry_strategy;
pub mod stream;
pub mod uri;

static IO_LIBRARY_INIT: Once = Once::new();

Expand Down
7 changes: 4 additions & 3 deletions aws-crt-s3/src/io/host_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ impl HostResolver {
pub fn new_default(allocator: &Allocator, options: &HostResolverDefaultOptions) -> Result<Self, Error> {
io_library_init(allocator);

let mut inner_options = aws_host_resolver_default_options {
let inner_options = aws_host_resolver_default_options {
el_group: options.event_loop_group.inner.as_ptr(),
max_entries: options.max_entries,
..Default::default()
};

let inner =
// SAFETY: aws_host_resolver_new_default makes acquires a reference to the inner event loop group.
unsafe { aws_host_resolver_new_default(allocator.inner.as_ptr(), &mut inner_options).ok_or_last_error()? };
// SAFETY: aws_host_resolver_new_default acquires a reference to the inner event loop
// group, and copies what it needs out of `inner_options`.
unsafe { aws_host_resolver_new_default(allocator.inner.as_ptr(), &inner_options).ok_or_last_error()? };

Ok(Self { inner })
}
Expand Down
2 changes: 1 addition & 1 deletion aws-crt-s3/src/s3/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use crate::auth::credentials::CredentialsProvider;
use crate::auth::signing_config::{SigningConfig, SigningConfigInner};
use crate::common::allocator::Allocator;
use crate::common::error::Error;
use crate::common::uri::Uri;
use crate::http::request_response::{Headers, Message};
use crate::io::channel_bootstrap::ClientBootstrap;
use crate::io::retry_strategy::RetryStrategy;
use crate::io::uri::Uri;
use crate::s3::s3_library_init;
use crate::{aws_byte_cursor_as_slice, CrtError, ResultExt, StringExt};
use aws_crt_s3_sys::*;
Expand Down
5 changes: 3 additions & 2 deletions s3-client/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::ffi::OsStr;
use std::os::unix::prelude::OsStrExt;

use aws_crt_s3::common::allocator::Allocator;
use aws_crt_s3::io::uri::Uri;
use aws_crt_s3::common::uri::Uri;
use lazy_static::lazy_static;
use regex::Regex;
use thiserror::Error;
Expand Down Expand Up @@ -86,7 +86,8 @@ fn is_valid_dns_name(bucket: &str) -> bool {
}

fn insert_virtual_host(bucket: &str, uri: &Uri) -> Result<Uri, InvalidUriError> {
if uri.path() != OsStr::from_bytes("/".as_bytes()) || !uri.query_string().is_empty() {
let empty_path = uri.path().is_empty() || uri.path() == OsStr::from_bytes("/".as_bytes());
if !empty_path || !uri.query_string().is_empty() {
return Err(InvalidUriError::CannotContainPathOrQueryString);
}

Expand Down
2 changes: 1 addition & 1 deletion s3-client/src/s3_crt_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ use std::time::{Duration, Instant};

use aws_crt_s3::auth::credentials::{CredentialsProvider, CredentialsProviderChainDefaultOptions};
use aws_crt_s3::common::allocator::Allocator;
use aws_crt_s3::common::uri::Uri;
use aws_crt_s3::http::request_response::{Header, Headers, Message};
use aws_crt_s3::io::channel_bootstrap::{ClientBootstrap, ClientBootstrapOptions};
use aws_crt_s3::io::event_loop::EventLoopGroup;
use aws_crt_s3::io::host_resolver::{HostResolver, HostResolverDefaultOptions};
use aws_crt_s3::io::retry_strategy::{ExponentialBackoffJitterMode, RetryStrategy, StandardRetryOptions};
use aws_crt_s3::io::stream::InputStream;
use aws_crt_s3::io::uri::Uri;
use aws_crt_s3::s3::client::{
init_default_signing_config, Client, ClientConfig, MetaRequestOptions, MetaRequestResult, MetaRequestType,
};
Expand Down

0 comments on commit a2dceaf

Please sign in to comment.