ruby-changes:11584
From: yugui <ko1@a...>
Date: Sun, 19 Apr 2009 22:34:28 +0900 (JST)
Subject: [ruby-changes:11584] Ruby:r23221 (ruby_1_9_1): merges r22998 from trunk into ruby_1_9_1.
yugui 2009-04-19 22:33:53 +0900 (Sun, 19 Apr 2009) New Revision: 23221 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23221 Log: merges r22998 from trunk into ruby_1_9_1. -- * lib/drb/drb.rb (open_server_inaddr_any): fixed multiple network families problem. a patch from Charl Matthee at [ruby-core:21033]. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/lib/drb/drb.rb Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 23220) +++ ruby_1_9_1/ChangeLog (revision 23221) @@ -1,3 +1,8 @@ +Wed Mar 18 02:41:33 2009 Masatoshi SEKI <m_seki@m...> + + * 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 <nobu@r...> * tool/make-snapshot (package): creates .revision.time and passes Index: ruby_1_9_1/lib/drb/drb.rb =================================================================== --- ruby_1_9_1/lib/drb/drb.rb (revision 23220) +++ ruby_1_9_1/lib/drb/drb.rb (revision 23221) @@ -842,15 +842,10 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/