From 2706b60ccbc5ebdf810bc496307815fa125647df Mon Sep 17 00:00:00 2001 From: tenderlove Date: Mon, 5 Mar 2012 22:19:35 +0000 Subject: * lib/xmlrpc/client.rb: switch net/http post2 calls to modern `request_post` methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/xmlrpc/client.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb index 21ebb2e604..8d899bc600 100644 --- a/lib/xmlrpc/client.rb +++ b/lib/xmlrpc/client.rb @@ -325,7 +325,7 @@ module XMLRPC @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 @@ module XMLRPC 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 @@ module XMLRPC # 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 @@ module XMLRPC @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 -- cgit v1.2.3