1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@53935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2016-02-25 10:29:39 +00:00
parent ca8b2d26f0
commit abe1b00d16
4 changed files with 34 additions and 8 deletions

View file

@ -1,3 +1,10 @@
Thu Feb 25 19:28:19 2016 Kouhei Sutou <kou@cozmixng.org>
* lib/xmlrpc/client.rb: Support SSL options in async methods of
XMLRPC::Client.
[Bug #11489]
Reported by Aleksandar Kostadinov. Thanks!!!
Thu Feb 25 19:25:25 2016 NARUSE, Yui <naruse@ruby-lang.org>
* marshal.c (r_object0): honor Marshal.load post proc

View file

@ -432,6 +432,24 @@ module XMLRPC # :nodoc:
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:
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:
end # class Client
end # module XMLRPC

View file

@ -9,10 +9,15 @@ end
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

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.9"
#define RUBY_RELEASE_DATE "2016-02-25"
#define RUBY_PATCHLEVEL 453
#define RUBY_PATCHLEVEL 454
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 2