mirror of
https://github.com/ruby/ruby.git
synced 2026-11-08 01:20:26 +08:00
[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 <noreply@anthropic.com>