Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Dec 8, 2023
1 parent 5b6394c commit c02cff8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/s3_auto_ranged_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static enum aws_s3_auto_ranged_get_request_type s_s3_get_discovers_size_request_
struct aws_s3_auto_ranged_get *auto_ranged_get = meta_request->impl;
AWS_ASSERT(auto_ranged_get);

// TODO: align the range_start on first part
if (auto_ranged_get->initial_message_has_range_header != 0)
return AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_HEAD_OBJECT;

Expand Down Expand Up @@ -756,7 +757,6 @@ static void s_s3_auto_ranged_get_request_finished(

/* If the object range was found, then record it. */
if (found_object_size) {
// TODO: align the range_start on first part
AWS_ASSERT(!auto_ranged_get->synced_data.object_range_known);
auto_ranged_get->synced_data.object_range_known = true;
auto_ranged_get->synced_data.object_range_empty = (total_content_length == 0);
Expand Down
8 changes: 3 additions & 5 deletions source/s3_meta_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,11 +1289,9 @@ static int s_s3_meta_request_headers_block_done(
request->request_tag == AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_GET_PART_NUMBER) {
uint64_t content_length;
if (!aws_s3_parse_content_length_response_header(
request->allocator, request->send_data.response_headers, &content_length)) {

if (content_length > meta_request->part_size) {
return aws_raise_error(AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE);
}
request->allocator, request->send_data.response_headers, &content_length) &&
content_length > meta_request->part_size) {
return aws_raise_error(AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE);
}
}
return AWS_OP_SUCCESS;
Expand Down

0 comments on commit c02cff8

Please sign in to comment.