Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Dec 4, 2023
1 parent 63e7f59 commit 1ba0e47
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions source/s3_auto_ranged_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,13 @@ static bool s_s3_auto_ranged_get_update(
auto_ranged_get->synced_data.num_parts_requested > 0) {
goto has_work_remaining;
}
/* If there exists a range header or we require validation of the response checksum, we currently
* always do a head request first. S3 returns the checksum of the entire object from the HEAD
* response
*
* For the range header value could be parsed client-side, doing so presents a number of
* complications. For example, the given range could be an unsatisfiable range, and might not even
* specify a complete range. To keep things simple, we are currently relying on the service to
* handle turning the Range header into a Content-Range response header.*/
bool head_object_required = auto_ranged_get->initial_message_has_range_header != 0;
// waahm7
if (head_object_required) {
/* If the head object request hasn't been sent yet, then send it now. */

/* If there exists a range header, we currently always do a head request first. For the range header
* value could be parsed client-side, doing so presents a number of complications. For example, the
* given range could be an unsatisfiable range, and might not even specify a complete range. To keep
* things simple, we are currently relying on the service to handle turning the Range header into a
* Content-Range response header.*/
if (auto_ranged_get->initial_message_has_range_header != 0) {
request = aws_s3_request_new(
meta_request,
AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_HEAD_OBJECT,
Expand All @@ -170,7 +165,7 @@ static bool s_s3_auto_ranged_get_update(

auto_ranged_get->synced_data.head_object_sent = true;
} else {
/* Try to download the firstPart of the object */
/* Get the object range from the first request */
struct aws_s3_buffer_pool_ticket *ticket =
aws_s3_buffer_pool_reserve(meta_request->client->buffer_pool, meta_request->part_size);

Expand Down Expand Up @@ -724,7 +719,9 @@ static void s_s3_auto_ranged_get_request_finished(
break;
case AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_GET_PART_NUMBER:
auto_ranged_get->synced_data.get_first_part_completed = true;
AWS_LOGF_DEBUG(AWS_LS_S3_META_REQUEST, "id=%p Get Part Number completed.", (void *)meta_request);
if (error_code == AWS_ERROR_S3_PART_SIZE_MISMATCH && found_object_size) {
/* Try to fetch the first part again as a ranged get */
break;
}
++auto_ranged_get->synced_data.num_parts_requested;
Expand Down

0 comments on commit 1ba0e47

Please sign in to comment.