eio icon indicating copy to clipboard operation
eio copied to clipboard

Keep writes within IOV_MAX

Open talex5 opened this issue 2 years ago • 1 comments

Calling Flow.write with more than IOV_MAX buffers results in EINVAL. This can happen when e.g. using Buf_write to write a lot of data without flushing.

Reported by @Cjen1 (see https://github.com/Cjen1/prototyping-testing/tree/master/eio-pipe).

Implementations of Flow.write with such limits should just truncate the list of buffers. Possibly Buf_write should also know the limit and flush before sending so many (or just use a low enough limit that it work on all platforms).

On Linux, https://github.com/ocaml-multicore/ocaml-uring/pull/76 can be used to get the limit.

talex5 avatar Oct 23 '23 09:10 talex5

I think this is the same issue: https://github.com/mirage/ocaml-cohttp/issues/1005

smondet avatar Nov 07 '23 22:11 smondet

Closing as the original issue is now fixed. I've opened a separate issue for back-pressure: #760

talex5 avatar Oct 04 '24 10:10 talex5