Project

General

Profile

Bug #7311 » 0001-Fallback-to-localhost-if-hostname-is-not-associated-.patch

Fallback to localhost if hosntame is not associated with IP - vo.x (Vit Ondruch), 11/08/2012 11:03 PM

View differences:

lib/drb/drb.rb
def self.getservername
host = Socket::gethostname
begin
raise unless Socket::ip_address_list.detect {|i| i.ip_address == Addrinfo.ip(host).ip_address}
Socket::gethostbyname(host)[0]
rescue
'localhost'
(2-2/2)