@@ -1753,11 +1753,8 @@ static int s_apply_backpressure_until_meta_request_finish(
17531753 size_t received_body_size_delta = aws_atomic_exchange_int (& test_results -> received_body_size_delta , 0 );
17541754 accumulated_data_size += (uint64_t )received_body_size_delta ;
17551755
1756- /* Check that we haven't received more data than the window allows.
1757- * TODO: Stop allowing "hacky wiggle room". The current implementation
1758- * may push more bytes to the user (up to 1 part) than they've asked for. */
1759- uint64_t hacky_wiggle_room = part_size ;
1760- uint64_t max_data_allowed = accumulated_window_increments + hacky_wiggle_room ;
1756+ /* Check that we haven't received more data than the window allows */
1757+ uint64_t max_data_allowed = accumulated_window_increments ;
17611758 ASSERT_TRUE (accumulated_data_size <= max_data_allowed , "Received more data than the read window allows" );
17621759
17631760 /* If we're done, we're done */
@@ -1891,7 +1888,7 @@ static int s_test_s3_get_object_backpressure_small_increments(struct aws_allocat
18911888 size_t file_size = 1 * 1024 * 1024 ; /* Test downloads 1MB file */
18921889 size_t part_size = file_size / 4 ;
18931890 size_t window_initial_size = 1024 ;
1894- uint64_t window_increment_size = part_size / 2 ;
1891+ uint64_t window_increment_size = part_size / 4 ;
18951892 return s_test_s3_get_object_backpressure_helper (
18961893 allocator , part_size , window_initial_size , window_increment_size , false);
18971894}
0 commit comments