From 3381ffee1de87eab0c6254796b40bcfc19fc78ca Mon Sep 17 00:00:00 2001 From: seki Date: Sat, 17 Mar 2018 15:13:39 +0000 Subject: [PATCH] If host of URI is omitted, make it with IP address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/drb/drb.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index b30f28cc7c..24187dc2ee 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -847,7 +847,11 @@ module DRb def self.getservername host = Socket::gethostname begin - Socket::gethostbyname(host)[0] + Socket::getaddrinfo(host, nil, + Socket::AF_UNSPEC, + Socket::SOCK_STREAM, + 0, + Socket::AI_PASSIVE)[0][3] rescue 'localhost' end