[PATCH] [ruby/rubygems] Probe socket errors via SO_ERROR in TCPSocketProbe
Calling connect_nonblock a second time to confirm a non-blocking
connect is not portable. On BSD-based systems such as macOS the second
connect returns EISCONN even after the asynchronous connect failed with
ECONNREFUSED, so a down mirror was reported as reachable. Check the
pending socket error with getsockopt(SO_ERROR) once IO.select reports
the socket writable instead.
https://github.com/ruby/rubygems/commit/b953dbd3c8
Co-Authored-By: Claude Opus 4.8 <[email protected]>