574464a6
docs: leg 1 is the agent probe's own sequence, not leg 2
a73x 2026-09-03 19:13
Commit message
src/os/client_os.zig
| Old | New | ||
|---|---|---|---|
| @@ -151,10 +151,13 @@ test "client_os.sendNoSig: a closed peer is an error, not a signal" { | |||
| 151 | }; | 151 | }; |
| 152 | std.posix.sigaction(std.posix.SIG.PIPE, &dfl, null); | 152 | std.posix.sigaction(std.posix.SIG.PIPE, &dfl, null); |
| 153 | // Two legs, because "the peer is gone" is two different states to | 153 | // Two legs, because "the peer is gone" is two different states to |
| 154 | // the kernel and only the second is the one the probe meets. A | 154 | // the kernel, and the first is the one the probe meets: |
| 155 | // socket that was NEVER written to and then lost its peer is the | 155 | // `mux_main.agentReachable` sends once on a socket it just connected |
| 156 | // easy case; a socket that carried bytes and then lost its peer is | 156 | // and then closes it, so a daemon that hung up in between leaves a |
| 157 | // the probe's own sequence, and on Darwin the two differ — the flag | 157 | // socket that was never written to. The second leg — a socket that |
| 158 | // carried bytes and then lost its peer — is asked because this | ||
| 159 | // operation is a contract and not one caller's helper, and on Darwin | ||
| 160 | // the two states differ where they do not on Linux: the flag | ||
| 158 | // that suppresses the signal is a socket option there, and a socket | 161 | // that suppresses the signal is a socket option there, and a socket |
| 159 | // the kernel has already shut down refuses to take one (see | 162 | // the kernel has already shut down refuses to take one (see |
| 160 | // `client_os_macos.sendNoSig`). A test that asked only the first | 163 | // `client_os_macos.sendNoSig`). A test that asked only the first |