Skip to content

Bigstring body - #52

Open
toots wants to merge 4 commits into
andersfugmann:mainfrom
toots:bigstring-body
Open

Bigstring body#52
toots wants to merge 4 commits into
andersfugmann:mainfrom
toots:bigstring-body

Conversation

@toots

@toots toots commented Aug 16, 2026

Copy link
Copy Markdown

This PR adds support for sending and receiving requests body as bigarray data.

toots added 4 commits August 10, 2026 08:02
head now returns the object's headers as content.response_headers, with find_header to look one up without minding the case the server chose, which covers content-type and anything else the API does not model.

ls parses an xml listing that carries no per-object headers, so the field is None there rather than an empty list.
Only a reader reaching a flush marker resolves the flush that queued it, so a
producer that bounds itself on flush is never woken once its consumer stops
reading. The expect-rejected path does exactly that: it skips send_body, and
nothing closed the body reader either.
An object body is the largest thing a caller moves through this library and the
one it never looks inside, so Body.t gains a Bigstring case and put_bigstring /
get_bigstring / Multipart_upload.upload_part_bigstring sit beside the string
forms rather than replacing them.

A request body reaches the socket as slices off the bigarray instead of one
object-sized string, bounded one slice ahead of the consumer as chunk_writer
already does, and its sigv4 payload hash is taken over the bigarray directly. A
response is gathered into a single off-heap buffer as the fragments arrive,
where to_string holds every fragment and then concatenates them.

The cli grows a --bigstring flag so integration.sh drives both spellings, each
direction checked against the other's.
Reading a file into a Bytes the size of the body, and writing one back out the
same way, puts the whole object on the heap that --bigstring exists to keep it
off, which made the flag measure as worse than the string path it replaces.
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.

1 participant