ruby-changes:14061
From: shyouhei <ko1@a...>
Date: Fri, 20 Nov 2009 15:52:33 +0900 (JST)
Subject: [ruby-changes:14061] Ruby:r25873 (ruby_1_8_7): merge revision(s) 25246:
shyouhei 2009-11-20 15:52:18 +0900 (Fri, 20 Nov 2009) New Revision: 25873 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25873 Log: merge revision(s) 25246: * lib/resolv.rb (Resolv::DNS.bind_random_port): bind to "::" for IPv6. (Resolv::DNS::ConnectedUDP#initialize): specify is_ipv6 argument of bind_random_port. [ruby-core:25970] Modified files: branches/ruby_1_8_7/ChangeLog branches/ruby_1_8_7/lib/resolv.rb branches/ruby_1_8_7/version.h Index: ruby_1_8_7/ChangeLog =================================================================== --- ruby_1_8_7/ChangeLog (revision 25872) +++ ruby_1_8_7/ChangeLog (revision 25873) @@ -1,3 +1,10 @@ +Fri Nov 20 15:49:59 2009 Tanaka Akira <akr@f...> + + * lib/resolv.rb (Resolv::DNS.bind_random_port): bind to "::" for IPv6. + (Resolv::DNS::ConnectedUDP#initialize): specify is_ipv6 argument of + bind_random_port. + [ruby-core:25970] + Thu Nov 19 18:03:31 2009 Takeyuki FUJIOKA <xibbar@r...> * lib/cgi.rb (CGI.unescapeHTML): fix for hex values 80-FF, Index: ruby_1_8_7/version.h =================================================================== --- ruby_1_8_7/version.h (revision 25872) +++ ruby_1_8_7/version.h (revision 25873) @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.7" -#define RUBY_RELEASE_DATE "2009-11-19" +#define RUBY_RELEASE_DATE "2009-11-20" #define RUBY_VERSION_CODE 187 -#define RUBY_RELEASE_CODE 20091119 -#define RUBY_PATCHLEVEL 215 +#define RUBY_RELEASE_CODE 20091120 +#define RUBY_PATCHLEVEL 216 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 7 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 19 +#define RUBY_RELEASE_DAY 20 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; Index: ruby_1_8_7/lib/resolv.rb =================================================================== --- ruby_1_8_7/lib/resolv.rb (revision 25872) +++ ruby_1_8_7/lib/resolv.rb (revision 25873) @@ -592,10 +592,10 @@ } end - def self.bind_random_port(udpsock) # :nodoc: + def self.bind_random_port(udpsock, is_ipv6=false) # :nodoc: begin port = rangerand(1024..65535) - udpsock.bind("", port) + udpsock.bind(is_ipv6 ? "::" : "", port) rescue Errno::EADDRINUSE retry end @@ -692,8 +692,9 @@ super() @host = host @port = port - @sock = UDPSocket.new(host.index(':') ? Socket::AF_INET6 : Socket::AF_INET) - DNS.bind_random_port(@sock) + is_ipv6 = host.index(':') + @sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET) + DNS.bind_random_port(@sock, is_ipv6) @sock.connect(host, port) @sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/