Skip to content

Commit 9c1bd19

Browse files
grrtrrwaahm7
andauthored
[meta request]: assign shutdown_callback inside critical region (#470)
Co-authored-by: Waqar Ahmed Khan <waahm7@gmail.com>
1 parent 205ebce commit 9c1bd19

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/s3_client.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,11 @@ struct aws_s3_meta_request *aws_s3_client_make_meta_request(
11261126
}
11271127

11281128
meta_request->endpoint = endpoint;
1129+
/**
1130+
* shutdown_callback must be the last thing that gets set on the meta_request so that we don’t return NULL and
1131+
* trigger the shutdown_callback.
1132+
*/
1133+
meta_request->shutdown_callback = options->shutdown_callback;
11291134

11301135
s_s3_client_push_meta_request_synced(client, meta_request);
11311136
s_s3_client_schedule_process_work_synced(client);
@@ -1146,11 +1151,6 @@ struct aws_s3_meta_request *aws_s3_client_make_meta_request(
11461151
meta_request = aws_s3_meta_request_release(meta_request);
11471152
} else {
11481153
AWS_LOGF_INFO(AWS_LS_S3_CLIENT, "id=%p: Created meta request %p", (void *)client, (void *)meta_request);
1149-
/**
1150-
* shutdown_callback must be the last thing that gets set on the meta_request so that we don’t return NULL and
1151-
* trigger the shutdown_callback.
1152-
*/
1153-
meta_request->shutdown_callback = options->shutdown_callback;
11541154
}
11551155

11561156
return meta_request;

0 commit comments

Comments
 (0)