Review report

core: PR #36716

2 suggestions

Optional improvements

Link

[suggestion] · Platform-specific exception registration lacks regression coverage

The existing socket wait test uses only ordinary data and never checks occurred events, so it cannot catch regressions in the new platform-specific exception registration.

Location: src/util/sock.cpp:219 (head).

Details and suggested fix

The wait test discards Wait()'s result and supplies no occurred-event output. It would still complete if exception registration returned on non-Windows or disappeared on Windows, and Linux uses the unchanged poll backend. Extend the TcpSocketPair tests to send one byte with MSG_OOB and no normal data, then call Wait() with a bounded timeout, RecvEvent, and an occurred-event output. Check that the wait succeeds and reports ErrorEvent on Windows but not outside Windows. A failed non-blocking connect test would need separate setup because TcpSocketPair currently completes a blocking connect successfully.


Link

[suggestion] · Wait's ErrorEvent contract omits platform-dependent behavior

Wait() still promises ErrorEvent for exceptional events, although the non-Windows select backend can no longer report it, leaving the documented contract inaccurate.

Location: src/util/sock.cpp:219 (head).

Details and suggested fix

After this change, macOS/BSD select never reports ErrorEvent, Windows select monitors exceptions only when RecvEvent was requested, and Linux poll maps only POLLERR/POLLHUP. Update the ErrorEvent and Wait() comments in sock.h to describe these backend-dependent indications rather than promise portable exception reporting. State that callers must also detect receive errors and EOF through RecvEvent and recv(), rather than infer connection health from the absence of ErrorEvent. Tor control already handles those receive results, so this is a documentation clarification rather than an established caller failure.


Coverage details