diff --git a/ChangeLog b/ChangeLog index 8fd16f295d..62c16a36ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 18 02:41:33 2009 Masatoshi SEKI + + * lib/drb/drb.rb (open_server_inaddr_any): fixed multiple network + families problem. a patch from Charl Matthee at [ruby-core:21033]. + Tue Mar 17 21:42:54 2009 Nobuyoshi Nakada * tool/make-snapshot (package): creates .revision.time and passes diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index 6a4e6021db..a2c11f980d 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -842,15 +842,10 @@ module DRb Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE) - family = infos.collect { |af, *_| af }.uniq - case family - when ['AF_INET'] - return TCPServer.open('0.0.0.0', port) - when ['AF_INET6'] - return TCPServer.open('::', port) - else - return TCPServer.open(port) - end + families = Hash[*infos.collect { |af, *_| af }.uniq.zip([]).flatten] + return TCPServer.open('0.0.0.0', port) if families.has_key?('AF_INET') + return TCPServer.open('::', port) if families.has_key?('AF_INET6') + return TCPServer.open(port) end # Open a server listening for connections at +uri+ using