aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmlrpc/client.rb
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-05 04:35:28 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-05 04:35:28 +0000
commitc3a750ebee3960f5ee47bcba4e60d8c3585eb843 (patch)
treee4d530fc5ca4a55652fb4d95ae728544f57d051c /lib/xmlrpc/client.rb
parent55148a250101b662fde32919f14afcf2dcdc801d (diff)
downloadruby-c3a750ebee3960f5ee47bcba4e60d8c3585eb843.tar.gz
* lib/xmlrpc/client.rb, lib/xmlrpc/server.rb: should use
String#bytesize instead of String#size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/xmlrpc/client.rb')
-rw-r--r--lib/xmlrpc/client.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb
index c09a9514d6..968292b077 100644
--- a/lib/xmlrpc/client.rb
+++ b/lib/xmlrpc/client.rb
@@ -501,7 +501,7 @@ module XMLRPC
header = {
"User-Agent" => USER_AGENT,
"Content-Type" => "text/xml; charset=utf-8",
- "Content-Length" => request.size.to_s,
+ "Content-Length" => request.bytesize.to_s,
"Connection" => (async ? "close" : "keep-alive")
}
@@ -559,10 +559,10 @@ module XMLRPC
end
expected = resp["Content-Length"] || "<unknown>"
- if data.nil? or data.size == 0
- raise "Wrong size. Was #{data.size}, should be #{expected}"
- elsif expected != "<unknown>" and expected.to_i != data.size and resp["Transfer-Encoding"].nil?
- raise "Wrong size. Was #{data.size}, should be #{expected}"
+ if data.nil? or data.bytesize == 0
+ raise "Wrong size. Was #{data.bytesize}, should be #{expected}"
+ elsif expected != "<unknown>" and expected.to_i != data.bytesize and resp["Transfer-Encoding"].nil?
+ raise "Wrong size. Was #{data.bytesize}, should be #{expected}"
end
set_cookies = resp.get_fields("Set-Cookie")