Skip to content

Commit

Permalink
Make options more const (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin authored Jul 13, 2024
1 parent 813c418 commit 0ab4d58
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'main'

env:
BUILDER_VERSION: v0.9.59
BUILDER_VERSION: v0.9.61
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-c-s3
Expand Down
21 changes: 11 additions & 10 deletions include/aws/s3/s3_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ struct aws_s3_client_config {
enum aws_s3_meta_request_tls_mode tls_mode;

/* TLS Options to be used for each connection, if tls_mode is ENABLED. When compiling with BYO_CRYPTO, and tls_mode
* is ENABLED, this is required. Otherwise, this is optional. */
struct aws_tls_connection_options *tls_connection_options;
* is ENABLED, this is required. Otherwise, this is optional.
*/
const struct aws_tls_connection_options *tls_connection_options;

/**
* Required.
Expand All @@ -387,7 +388,7 @@ struct aws_s3_client_config {
*
* TODO: deprecate this structure from auth, introduce a new S3 specific one.
*/
struct aws_signing_config_aws *signing_config;
const struct aws_signing_config_aws *signing_config;

/**
* Optional.
Expand Down Expand Up @@ -445,7 +446,7 @@ struct aws_s3_client_config {
* If the connection_type is AWS_HPCT_HTTP_LEGACY, it will be converted to AWS_HPCT_HTTP_TUNNEL if tls_mode is
* ENABLED. Otherwise, it will be converted to AWS_HPCT_HTTP_FORWARD.
*/
struct aws_http_proxy_options *proxy_options;
const struct aws_http_proxy_options *proxy_options;

/**
* Optional.
Expand All @@ -454,7 +455,7 @@ struct aws_s3_client_config {
* configuration from environment.
* Only works when proxy_options is not set. If both are set, configuration from proxy_options is used.
*/
struct proxy_env_var_settings *proxy_ev_settings;
const struct proxy_env_var_settings *proxy_ev_settings;

/**
* Optional.
Expand All @@ -466,15 +467,15 @@ struct aws_s3_client_config {
* Optional.
* Set keepalive to periodically transmit messages for detecting a disconnected peer.
*/
struct aws_s3_tcp_keep_alive_options *tcp_keep_alive_options;
const struct aws_s3_tcp_keep_alive_options *tcp_keep_alive_options;

/**
* Optional.
* Configuration options for connection monitoring.
* If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.
* If set to NULL, default values are used.
*/
struct aws_http_connection_monitoring_options *monitoring_options;
const struct aws_http_connection_monitoring_options *monitoring_options;

/**
* Enable backpressure and prevent response data from downloading faster than you can handle it.
Expand Down Expand Up @@ -572,7 +573,7 @@ struct aws_s3_checksum_config {
*
* If the response checksum was validated by client, the result will indicate which algorithm was picked.
*/
struct aws_array_list *validate_checksum_algorithms;
const struct aws_array_list *validate_checksum_algorithms;
};

/**
Expand Down Expand Up @@ -760,7 +761,7 @@ struct aws_s3_meta_request_options {
* - Both Host and Endpoint is set - Host header must match Authority of
* Endpoint uri. Port and Scheme from endpoint is used.
*/
struct aws_uri *endpoint;
const struct aws_uri *endpoint;

/**
* Optional.
Expand All @@ -778,7 +779,7 @@ struct aws_s3_meta_request_options {
* Set this hint to help the S3 client choose the best strategy for this particular file.
* This is just used as an estimate, so it's okay to provide an approximate value if the exact size is unknown.
*/
uint64_t *object_size_hint;
const uint64_t *object_size_hint;
};

/* Result details of a meta request.
Expand Down
2 changes: 1 addition & 1 deletion tests/s3_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int aws_s3_tester_bind_client(struct aws_s3_tester *tester, struct aws_s3_client
config->region = g_test_s3_region;
} else {
if (config->signing_config) {
config->signing_config->region = config->region;
((struct aws_signing_config_aws *)config->signing_config)->region = config->region;
}
}
if (!config->signing_config) {
Expand Down

0 comments on commit 0ab4d58

Please sign in to comment.