Skip to content

Commit

Permalink
[meta request]: assign shutdown_callback inside critical region (#470)
Browse files Browse the repository at this point in the history
Co-authored-by: Waqar Ahmed Khan <[email protected]>
  • Loading branch information
grrtrr and waahm7 authored Dec 3, 2024
1 parent 205ebce commit 9c1bd19
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,11 @@ struct aws_s3_meta_request *aws_s3_client_make_meta_request(
}

meta_request->endpoint = endpoint;
/**
* shutdown_callback must be the last thing that gets set on the meta_request so that we don’t return NULL and
* trigger the shutdown_callback.
*/
meta_request->shutdown_callback = options->shutdown_callback;

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

return meta_request;
Expand Down

0 comments on commit 9c1bd19

Please sign in to comment.