@@ -464,8 +464,11 @@ static void s_s3_auto_ranged_put_send_request_finish(
464464 struct aws_http_stream * stream ,
465465 int error_code ) {
466466 struct aws_s3_request * request = connection -> request ;
467- if (request -> request_tag == AWS_S3_AUTO_RANGED_PUT_REQUEST_TAG_PART ) {
467+ if (request -> request_tag == AWS_S3_AUTO_RANGED_PUT_REQUEST_TAG_PART && ! request -> meta_request -> is_express ) {
468468 /* TODO: the single part upload may also be improved from a timeout as multipart. */
469+ /* Note: For S3express, server responses random ETag. Killing the connection in the middle may cause server
470+ * receive two same part and result in confusing during complete MPU with etag doesn't match.
471+ * Disable the first byte timeout for s3 express. */
469472 aws_s3_client_update_upload_part_timeout (request -> meta_request -> client , request , error_code );
470473 }
471474 aws_s3_meta_request_send_request_finish_default (connection , stream , error_code );
@@ -1216,11 +1219,13 @@ static void s_s3_prepare_upload_part_finish(struct aws_s3_prepare_upload_part_jo
12161219 aws_s3_meta_request_lock_synced_data (meta_request );
12171220 struct aws_s3_mpu_part_info * part = NULL ;
12181221 aws_array_list_get_at (& auto_ranged_put -> synced_data .part_list , & part , request -> part_number - 1 );
1222+ /**
1223+ * 1. If request retries, get the checksum context from the previous attempt to reuse it. In case of the the
1224+ * request body in memory mangled
1225+ * 2. If this is the first attempt, the context is initialized from the previous prepare step.
1226+ **/
12191227 AWS_ASSERT (part != NULL && part -> checksum_context != NULL );
1220- /* Use checksum context if available, otherwise NULL for new parts */
12211228 checksum_context = part -> checksum_context ;
1222- /* If checksum already calculated, it means either the part being retried or the part resumed from list
1223- * parts. Keep reusing the old checksum in case of the request body in memory mangled */
12241229 aws_s3_meta_request_unlock_synced_data (meta_request );
12251230 }
12261231 /* END CRITICAL SECTION */
0 commit comments