You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(io): treat a fully transferred read/write as success
read and write reported any error_code surfaced by the final
read_some/write_some, even when that completion delivered the last bytes
and filled the buffer. A generic observer (when_any/when_all) then saw a
completed transfer as a failure. The most common trigger is end-of-stream
coincident with a full read (read_some returns [eof, n] that fills the
buffer).
Report the contingency only when the buffer was not fully transferred:
when n == buffer_size(buffers) the transfer succeeded and ec is success.
Tighten the documented postcondition accordingly.
Codify the same invariant in the ReadStream and WriteStream concept
contracts: a read_some/write_some that fills its buffer reports success,
so n == buffer_size(buffers) implies no error (a coincident condition such
as end-of-stream surfaces on a subsequent call).
Add a mock stream that reports a contingency in the same completion that
transfers bytes (the test read/write streams report errors with zero
bytes) and cover both the filled-is-success and short-transfer-is-reported
cases.
0 commit comments