Skip to content

Fix definition of PartialOp::Limited to consume just the number of bytes written #32

@sunshowers

Description

@sunshowers

Let's say we have a PartialOp::Limited(4096). If a write call results in 1024 bytes being written, we consume the entire PartialOp::Limited.

Because of buffering and such, this means that we can't predict how many bytes would be written out before an error.

Instead, what we should do is consume just the number of bytes written, in this case transforming the PartialOp::Limited(4096) to PartialOp::Limited(3072). That would make it so that we can statically analyze a list of operations to determine how many bytes would be written before an error occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions