ruby-changes:22867
From: tenderlove <ko1@a...>
Date: Tue, 6 Mar 2012 07:19:49 +0900 (JST)
Subject: [ruby-changes:22867] tenderlove:r34916 (trunk): * lib/xmlrpc/client.rb: switch net/http post2 calls to modern
tenderlove 2012-03-06 07:19:35 +0900 (Tue, 06 Mar 2012) New Revision: 34916 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34916 Log: * lib/xmlrpc/client.rb: switch net/http post2 calls to modern `request_post` methods. Modified files: trunk/ChangeLog trunk/lib/xmlrpc/client.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 34915) +++ ChangeLog (revision 34916) @@ -1,3 +1,8 @@ +Tue Mar 6 07:18:10 2012 Aaron Patterson <aaron@t...> + + * lib/xmlrpc/client.rb: switch net/http post2 calls to modern + `request_post` methods. + Tue Mar 6 02:31:20 2012 Aaron Patterson <aaron@t...> * ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded Index: lib/xmlrpc/client.rb =================================================================== --- lib/xmlrpc/client.rb (revision 34915) +++ lib/xmlrpc/client.rb (revision 34916) @@ -325,7 +325,7 @@ @proxy_port = @proxy_port.to_i if @proxy_port != nil # HTTP object for synchronous calls - @http = Net::HTTP.new(@host, @port, @proxy_host, @proxy_port) + @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 @@ -491,6 +491,10 @@ private # ---------------------------------------------------------- + def net_http(host, port, proxy_host, proxy_port) + Net::HTTP.new host, port, proxy_host, proxy_port + end + def set_auth if @user.nil? @auth = nil @@ -529,7 +533,7 @@ # post request http.start { - resp = http.post2(@path, request, header) + resp = http.request_post(@path, request, header) } else # reuse the HTTP object for each call => connection alive is possible @@ -538,7 +542,7 @@ @http.start if not @http.started? # post request - resp = @http.post2(@path, request, header) + resp = @http.request_post(@path, request, header) end @http_last_response = resp -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/