aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmlrpc
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-05 22:19:35 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-05 22:19:35 +0000
commit2706b60ccbc5ebdf810bc496307815fa125647df (patch)
tree7987c11f430341b6a381eeb47441d5f0085c823b /lib/xmlrpc
parent8456c0603e8a121416445fad5cbe4527db8ca1af (diff)
downloadruby-2706b60ccbc5ebdf810bc496307815fa125647df.tar.gz
* 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
Diffstat (limited to 'lib/xmlrpc')
-rw-r--r--lib/xmlrpc/client.rb10
1 files changed, 7 insertions, 3 deletions
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