Skip to content

Commit

Permalink
Don't expose client-option compute_content_md5. It would be better as…
Browse files Browse the repository at this point in the history
… a request-option, but changing that would be a lot of work. Also, flexible-checksums are better in every way. So let's only expose those for now.
  • Loading branch information
graebm committed Oct 17, 2023
1 parent f185c99 commit 127adc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
15 changes: 1 addition & 14 deletions awscrt/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ class S3Client(NativeResource):
throughput_target_gbps (Optional[float]): Throughput target in Gbps that we are trying to reach.
(5 Gbps by default)
compute_content_md5 (Optional[bool]):
Whether to calculate and add the "Content-MD5" header to upload
requests that could use it (no other checksum algorithm is being used,
and the header is not already present or the upload is being split
into parts). For single-part uploads, if the Content-MD5 header is
already present, it will remain unchanged.
(False by default)
"""

__slots__ = ('shutdown_event', '_region')
Expand All @@ -163,8 +155,7 @@ def __init__(
credential_provider=None,
tls_connection_options=None,
part_size=None,
throughput_target_gbps=None,
compute_content_md5=None):
throughput_target_gbps=None):
assert isinstance(bootstrap, ClientBootstrap) or bootstrap is None
assert isinstance(region, str)
assert isinstance(signing_config, AwsSigningConfig) or signing_config is None
Expand Down Expand Up @@ -195,9 +186,6 @@ def on_shutdown():

s3_client_core = _S3ClientCore(bootstrap, credential_provider, signing_config, tls_connection_options)

if compute_content_md5 is None:
compute_content_md5 = False

# C layer uses 0 to indicate defaults
if tls_mode is None:
tls_mode = 0
Expand All @@ -216,7 +204,6 @@ def on_shutdown():
tls_mode,
part_size,
throughput_target_gbps,
compute_content_md5,
s3_client_core)

def make_request(
Expand Down
5 changes: 1 addition & 4 deletions source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ PyObject *aws_py_s3_client_new(PyObject *self, PyObject *args) {
int tls_mode; /* i */
uint64_t part_size; /* K */
double throughput_target_gbps; /* d */
int compute_content_md5; /* p - boolean predicate */
PyObject *py_core; /* O */
if (!PyArg_ParseTuple(
args,
"OOOOOs#iKdpO",
"OOOOOs#iKdO",
&bootstrap_py,
&signing_config_py,
&credential_provider_py,
Expand All @@ -95,7 +94,6 @@ PyObject *aws_py_s3_client_new(PyObject *self, PyObject *args) {
&tls_mode,
&part_size,
&throughput_target_gbps,
&compute_content_md5,
&py_core)) {
return NULL;
}
Expand Down Expand Up @@ -162,7 +160,6 @@ PyObject *aws_py_s3_client_new(PyObject *self, PyObject *args) {
.part_size = part_size,
.tls_connection_options = tls_options,
.throughput_target_gbps = throughput_target_gbps,
.compute_content_md5 = compute_content_md5 != 0,
.shutdown_callback = s_s3_client_shutdown,
.shutdown_callback_user_data = s3_client,
};
Expand Down

0 comments on commit 127adc9

Please sign in to comment.