1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
seki 2018-03-17 15:13:39 +00:00
parent 2948dc26bd
commit 3381ffee1d

View file

@ -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