@@ -69,7 +69,6 @@ struct aws_parallel_input_stream_from_file_impl {
6969
7070 struct aws_string * file_path ;
7171 struct aws_event_loop_group * reading_elg ;
72- size_t num_of_thread ;
7372};
7473
7574static void s_para_from_file_destroy (struct aws_parallel_input_stream * stream ) {
@@ -157,6 +156,7 @@ static void s_s3_parallel_from_file_read_task(struct aws_task *task, void *arg,
157156 } else {
158157 /* Return true if we reached EOF */
159158 bool eof_reached = (actually_read < read_task -> length );
159+ AWS_ASSERT (!eof_reached );
160160 aws_future_bool_set_result (end_future , eof_reached );
161161 }
162162
@@ -297,7 +297,7 @@ static int s_aws_s3_mmap_part_streaming_input_stream_read(struct aws_input_strea
297297 struct aws_byte_buf * tmp = impl -> reading_chunk_buf ;
298298 impl -> reading_chunk_buf = impl -> loading_chunk_buf ;
299299 impl -> loading_chunk_buf = tmp ;
300- size_t new_offset = impl -> offset + impl -> total_length_read + impl -> chunk_load_size ;
300+ size_t new_offset = impl -> offset + impl -> total_length_read + impl -> reading_chunk_buf -> len ;
301301 size_t new_load_length = aws_min_size (
302302 impl -> chunk_load_size , impl -> total_length - impl -> total_length_read - impl -> reading_chunk_buf -> len );
303303 if (new_load_length > 0 && !impl -> eos_loaded ) {
@@ -322,6 +322,7 @@ static int s_aws_s3_mmap_part_streaming_input_stream_read(struct aws_input_strea
322322 if (impl -> eos_loaded || impl -> total_length_read == impl -> total_length ) {
323323 /* We reached the end of the stream. */
324324 impl -> eos_reached = true;
325+ AWS_ASSERT (impl -> total_length_read == impl -> total_length );
325326 }
326327 }
327328
0 commit comments