aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/xmlrpc/client.rb10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index dc0c3b837b..6cd07620ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
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