Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tests to use net_test_case #382

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions source/s3_auto_ranged_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ static bool s_s3_auto_ranged_get_update(
* turning the Range header into a Content-Range response header.*/
bool head_object_required = auto_ranged_get->initial_message_has_range_header != 0 ||
meta_request->checksum_config.validate_response_checksum;

if (head_object_required) {
// waahm7
if (false && head_object_required) {
/* If the head object request hasn't been sent yet, then send it now. */
if (!auto_ranged_get->synced_data.head_object_sent) {
request = aws_s3_request_new(
Expand Down Expand Up @@ -376,11 +376,22 @@ static struct aws_future_void *s_s3_auto_ranged_get_prepare_request(struct aws_s
}
break;
case AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_PART:
message = aws_s3_ranged_get_object_message_new(
meta_request->allocator,
meta_request->initial_request_message,
request->part_range_start,
request->part_range_end);
// waahm7
if (request->discovers_object_size) {
message = aws_s3_message_util_copy_http_message_no_body_all_headers(
meta_request->allocator, meta_request->initial_request_message);
if (message) {
aws_s3_message_util_set_multipart_request_path(
meta_request->allocator, NULL, request->part_number, false, message);
}
} else {
// Todo waahm7: fix this with proper adding range header here
message = aws_s3_ranged_get_object_message_new(
meta_request->allocator,
meta_request->initial_request_message,
request->part_range_start,
request->part_range_end);
}
break;
case AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_INITIAL_MESSAGE:
message = aws_s3_message_util_copy_http_message_no_body_all_headers(
Expand Down
4 changes: 3 additions & 1 deletion source/s3_meta_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ static int s_meta_request_get_response_headers_checksum_callback(
continue;
}
const struct aws_byte_cursor *algorithm_header_name = aws_get_http_header_name_from_algorithm(i);
if (aws_http_headers_has(headers, *algorithm_header_name)) {
const struct aws_byte_cursor parts_count_header_name = aws_byte_cursor_from_c_str("x-amz-mp-parts-count");
if (aws_http_headers_has(headers, *algorithm_header_name) &&
!aws_http_headers_has(headers, parts_count_header_name)) {
struct aws_byte_cursor header_sum;
aws_http_headers_get(headers, *algorithm_header_name, &header_sum);
size_t encoded_len = 0;
Expand Down
6 changes: 3 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ add_net_test_case(test_s3_upload_review)
add_net_test_case(test_s3_upload_review_no_content_length)
add_net_test_case(test_s3_upload_review_rejection)

add_test_case(test_s3_list_bucket_init_mem_safety)
add_test_case(test_s3_list_bucket_init_mem_safety_optional_copies)
add_net_test_case(test_s3_list_bucket_init_mem_safety)
add_net_test_case(test_s3_list_bucket_init_mem_safety_optional_copies)
add_net_test_case(test_s3_list_bucket_valid)

# Tests against local mock server
Expand Down Expand Up @@ -302,7 +302,7 @@ add_test_case(test_s3_buffer_pool_trim)
add_test_case(test_s3_buffer_pool_reservation_hold)
add_net_test_case(test_s3_put_object_buffer_pool_trim)

add_test_case(client_update_upload_part_timeout)
add_net_test_case(client_update_upload_part_timeout)

set(TEST_BINARY_NAME ${PROJECT_NAME}-tests)
generate_test_driver(${TEST_BINARY_NAME})
Expand Down
Loading