ruby-changes:41995
From: nagachika <ko1@a...>
Date: Wed, 9 Mar 2016 23:01:08 +0900 (JST)
Subject: [ruby-changes:41995] nagachika:r54069 (ruby_2_2): merge revision(s) 53318: [Backport #11489]
nagachika 2016-03-09 23:01:02 +0900 (Wed, 09 Mar 2016) New Revision: 54069 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54069 Log: merge revision(s) 53318: [Backport #11489] * lib/xmlrpc/client.rb: Support SSL options in async methods of XMLRPC::Client. [Bug #11489] Reported by Aleksandar Kostadinov. Thanks!!! Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/lib/xmlrpc/client.rb branches/ruby_2_2/test/xmlrpc/test_client.rb branches/ruby_2_2/version.h Index: ruby_2_2/lib/xmlrpc/client.rb =================================================================== --- ruby_2_2/lib/xmlrpc/client.rb (revision 54068) +++ ruby_2_2/lib/xmlrpc/client.rb (revision 54069) @@ -432,6 +432,24 @@ module XMLRPC # :nodoc: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/xmlrpc/client.rb#L432 Net::HTTP.new host, port, proxy_host, proxy_port end + def dup_net_http + http = net_http(@http.address, + @http.port, + @http.proxy_address, + @http.proxy_port) + http.proxy_user = @http.proxy_user + http.proxy_pass = @http.proxy_pass + if @http.use_ssl? + http.use_ssl = true + Net::HTTP::SSL_ATTRIBUTES.each do |attribute| + http.__send__("#{attribute}=", @http.__send__(attribute)) + end + end + http.read_timeout = @http.read_timeout + http.open_timeout = @http.open_timeout + http + end + def set_auth if @user.nil? @auth = nil @@ -463,10 +481,7 @@ module XMLRPC # :nodoc: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/xmlrpc/client.rb#L481 if async # use a new HTTP object for each call - http = net_http(@host, @port, @proxy_host, @proxy_port) - http.use_ssl = @use_ssl if @use_ssl - http.read_timeout = @timeout - http.open_timeout = @timeout + http = dup_net_http # post request http.start { @@ -611,4 +626,3 @@ module XMLRPC # :nodoc: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/xmlrpc/client.rb#L626 end # class Client end # module XMLRPC - Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 54068) +++ ruby_2_2/ChangeLog (revision 54069) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Wed Mar 9 22:59:43 2016 Kouhei Sutou <kou@c...> + + * lib/xmlrpc/client.rb: Support SSL options in async methods of + XMLRPC::Client. + [Bug #11489] + Reported by Aleksandar Kostadinov. Thanks!!! + Wed Mar 9 22:46:56 2016 NARUSE, Yui <naruse@r...> * marshal.c (r_object0): honor Marshal.load post proc Index: ruby_2_2/test/xmlrpc/test_client.rb =================================================================== --- ruby_2_2/test/xmlrpc/test_client.rb (revision 54068) +++ ruby_2_2/test/xmlrpc/test_client.rb (revision 54069) @@ -9,10 +9,15 @@ end https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/xmlrpc/test_client.rb#L9 module XMLRPC class ClientTest < MiniTest::Unit::TestCase module Fake - class HTTP - attr_accessor :read_timeout, :open_timeout, :use_ssl + class HTTP < Net::HTTP + class << self + def new(*args, &block) + Class.method(:new).unbind.bind(self).call(*args, &block) + end + end def initialize responses = {} + super("127.0.0.1") @started = false @responses = responses end Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 54068) +++ ruby_2_2/version.h (revision 54069) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.5" #define RUBY_RELEASE_DATE "2016-03-09" -#define RUBY_PATCHLEVEL 252 +#define RUBY_PATCHLEVEL 253 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r53318 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/