Repository activity
40458 results across all weeks
eio_posix: connect to a full Unix-domain listener returns an unconnected socket
On Linux, a non-blocking connect on a Unix-domain socket whose listener's backlog is full fails with EAGAIN, which means "not connected, try again" rather than "in progress" as for TCP. connect in lib_eio_posix/low_level.ml handles EAGAIN like EINPROGRESS: it waits for the socket to be writable, finds no error in SO_ERROR, and returns. The caller gets a sock…
Thomas Gazagnaire (@samoht)eio_posix: creating a file at a path with a trailing slash fails with EINVAL
Creating a file at a path that ends in a slash fails with EINVAL on eio_posix. Linux's open(2) and eio_linux give EISDIR. open_unconfined in lib_eio_posix/low_level.ml adds O_DIRECTORY when the path has a trailing slash, and the kernel rejects O_CREAT | O_DIRECTORY with EINVAL.
Thomas Gazagnaire (@samoht)eio_posix: fix error handling in `connect`
Here, EAGAIN indicates that the backlog is full (for Unix-domain sockets) or "insufficient entries in the routing cache", not that we're in the process of connecting.
Thomas Leonard (@talex5)eio_windows: connect to a closed port never returns
I hit this while recording how sockets answer on Windows: with eio_windows, Eio.Net.connect to a TCP port nobody listens on never returns. This program expects Connection_failure Refused and gives up after 10 seconds:
Thomas Gazagnaire (@samoht)eio_windows: fix anonymous pipes on Windows
This is a testcase failing on my machine atm, so opening to check windows CI here as well (I'm struggling with Windows Redirection Guard nuking my ssh setup due to the use of symlinks in Flexlink!)
Anil Madhavapeddy (@avsm)eio_windows: reads and writes after a shutdown
It seems that eio_windows and eio_posix disagree on what happens after a socket's own shutdown:
Thomas Gazagnaire (@samoht)getaddrinfo errors are all NONAME on Windows
Every failed lookup through eio_windows comes back as Address_lookup_failed NONAME, including an unknown service, which Linux reports as SERVICE:
Thomas Gazagnaire (@samoht)getnameinfo raises a raw Not_found when the lookup fails
Eio_unix.Net.getnameinfo, which both eio_posix and eio_linux use, calls Unix.getnameinfo, which raises Not_found when the lookup fails. It reaches the caller unwrapped, so a handler for Eio.Io misses it, and the getnameinfo docs do not mention it.
Thomas Gazagnaire (@samoht)windows: report oversized command lines as argument list too long
This is extracted from #979 as a standalone bug fix. The arg size of CreateProcessW is hardcoded.
Anil Madhavapeddy (@avsm)windows: report sandbox root mkdir as already existing
There was a corner case (revealed by #979) that made Windows differ from other backends. This change makes:
Anil Madhavapeddy (@avsm)windows: resolve DOS device names in unrestricted paths
On Windows, we shouldnt treat verbatim devices as relative paths, so classify them specially. Fixes #990 and also a regression that prevents Forester 6.0 working with latest Eio (since it uses Filename.null as a redirection target, which then tries to use that as a relative file!)
Anil Madhavapeddy (@avsm)Benchmark Unix-domain sockets
This adds a benchmark testing sending a small amount of data over a Unix-domain datagram socket. The purpose is to test the improvements in #168 and #167.
Thomas Leonard (@talex5)Clamp I/O lengths to what the SQE's 32-bit field can hold
Cherry-picked from @avsm's #167.
Thomas Leonard (@talex5)Fix some minor compiler warnings
Note: compiling with -Wall still fails, with:
Thomas Leonard (@talex5)Handle failing operations better
accept: leave the Sockaddr.t untouched if the submission queue is full
Thomas Leonard (@talex5)Install a better Cstruct printer for the tests
The buffers are all quite short, so just display them directly. Avoids noise showing internal details, and converting to strings all over the place.
Thomas Leonard (@talex5)More hardening fixes for uring bindings
I did another hardening pass over the bindings. Each commit below has an associated test case where appropriate. We could drop 9749cc7b4484e9db90d835e6d1c8f191235e01f0 if 32-bit support is not of interest.
Anil Madhavapeddy (@avsm)Reject more than iov_max buffers before queuing anything
Cherry-picked from @avsm's #167.
Thomas Leonard (@talex5)Reject paths containing NUL bytes instead of truncating them
Cherry-picked from @avsm's #167.
Thomas Leonard (@talex5)Remove deprecated functions from the API and inline msg_name
This removes peek (deprecated since 0.4) and Msghdr.create (deprecated since 2.15.1 and not safe for Unix-domain sockets).
Thomas Leonard (@talex5)