Skip to content

feat(s3-crt): zero-copy GetObject via caller-owned recv_buffer - #4018

Merged
sbiscigl merged 1 commit into
mainfrom
s3crt-recv-buffer
Dec 4, 2026
Merged

sbiscigl merged 1 commit into
mainfrom
s3crt-recv-buffer

Conversation

@sbiscigl

@sbiscigl sbiscigl commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Issue #, if available:

#4013

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Continuing the discussion in #3993: adds GetObjectRequest::SetRecvBuffer(),
exposing aws-c-s3's recv_buffer option (present since aws-c-s3 v1.5.2) on
S3CrtClient::GetObject. Response bytes are written directly into the
caller's buffer instead of the CRT's pooled buffer, eliminating one
full-object-sized copy per GET.

Changes the code generator templates, not generated output by hand, per
CONTRIBUTING.md; the included generated-file diffs were produced by
building and running the generator against the real s3 C2J model.

Also frees userData before the early return when
aws_s3_client_make_meta_request fails, in GetObject, PutObject, and
CopyObject.

Tests: unit tests covering the new request accessors, and an integration
test (modeled on the existing NoAuthPublicBucket test) that downloads a
real public object via recv_buffer, byte-compares it against a normal
GetObject, and confirms a part-number GET and a too-small buffer both
fail the outcome cleanly. All built and run against the real SDK.

Signed-off-by: Ben Ami Zilber <bzilber@nvidia.com>
@sbiscigl
sbiscigl marked this pull request as ready for review December 4, 2026 15:26
@sbiscigl
sbiscigl requested a review from averyk22 December 4, 2026 16:07
@sbiscigl
sbiscigl added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 5f4900e Dec 4, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants