eio
eio copied to clipboard
Keep writes within IOV_MAX
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.
I think this is the same issue: https://github.com/mirage/ocaml-cohttp/issues/1005
Closing as the original issue is now fixed. I've opened a separate issue for back-pressure: #760