* 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
This commit is contained in:
tenderlove 2012-03-05 22:19:35 +00:00
Родитель 8456c0603e
Коммит 2706b60ccb
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Mar 6 07:18:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
* lib/xmlrpc/client.rb: switch net/http post2 calls to modern
`request_post` methods.
Tue Mar 6 02:31:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded

Просмотреть файл

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