summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-17 17:43:48 +0000
committerseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-17 17:43:48 +0000
commit998217fb3d8bb905641fc7e2216466a766bee408 (patch)
treee04af47e169f85ba882357da4fc68e8069c63d99
parent39dfe919094c76461865196a7444ca4e76a46251 (diff)
* lib/drb/drb.rb (open_server_inaddr_any): fixed multiple network
families problem. a patch from Charl Matthee at [ruby-core:21033]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/drb/drb.rb13
2 files changed, 9 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 8fd16f295d7..62c16a36ee1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 18 02:41:33 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * 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@ruby-lang.org>
* tool/make-snapshot (package): creates .revision.time and passes
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 6a4e6021dbf..a2c11f980d9 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