Files
fips/src/native
Johnathan Corgan d7f079618f Document that an empty datagram sent just before a close reads as the close on Linux
The native API's receive rule cannot tell a zero-length datagram that is
the last message before a close from the close itself on SOCK_SEQPACKET,
which Linux uses: reading it drains the queue, and every observation
then matches a bare end of file. macOS and FreeBSD carry the flow on
SOCK_DGRAM, where the empty datagram is delivered and the close is
reported by the read after it.

The doc comment on Received::Datagram said an empty datagram is never a
close, which contradicted the limitation stated a few hundred lines
below it. It now says where the exception applies, and the recv_once
rationale, the FipsStream::recv rustdoc, the native API reference and
the client how-to scope the limitation to Linux. The reference page's
list of places where data disappears gains the send-side consequence:
a program that sends an empty datagram and then drops its stream may
have the daemon read it as the close, so it never reaches the peer. The
datagram how-to, which counts those places, is updated to match.

A new test pins the behaviour per socket type, branching on the
module's socket-type constant rather than on the OS, so the
documentation and the test cannot drift apart.
2026-09-27 19:35:11 +00:00
..