mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Fix the timeout of getaddrinfo with a nil host or service
Building the error message from a NULL pointer raised ArgumentError instead of IO::TimeoutError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
47d566434f
commit
021446fa21
1 file changed
+2
-2
Notes:
git
2026-10-27 23:43:29 +00:00
@@ -651,8 +651,8 @@ start:
|
||||
if (need_free) free_getaddrinfo_arg(arg);
|
||||
|
||||
if (timedout) {
|
||||
VALUE host = rb_str_new_cstr(hostp);
|
||||
VALUE port = rb_str_new_cstr(portp);
|
||||
VALUE host = hostp ? rb_str_new_cstr(hostp) : Qnil;
|
||||
VALUE port = portp ? rb_str_new_cstr(portp) : Qnil;
|
||||
rsock_raise_user_specified_timeout(NULL, host, port);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user