diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-08 09:41:24 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-08 09:41:24 +0000 |
commit | 877ac7236a8c509959eddc5add7ba0f10fae4804 (patch) | |
tree | ca9b63d5311f04114dbf248265560744cbe9b415 /lib/webrick/httpresponse.rb | |
parent | 75fcee4a23d5a549f407a0404732e2ccc6b949e1 (diff) | |
download | ruby-877ac7236a8c509959eddc5add7ba0f10fae4804.tar.gz |
* lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT):
use #bytesize instead of #size. a patch submitted from
raspberry lemon in [ruby-core:18571].
* lib/webrick/httpauth/digestauth.rb, lib/webrick/httpproxy.rb,
lib/webrick/httprequest.rb, lib/webrick/httpservlet/cgi_runner.rb,
lib/webrick/httpservlet/abstract.rb, lib/webrick/httpresponse.rb,
lib/webrick/httpservlet/cgihandler.rb, lib/webrick/utils.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/httpresponse.rb')
-rw-r--r-- | lib/webrick/httpresponse.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb index 301ecb8372..740a8fe921 100644 --- a/lib/webrick/httpresponse.rb +++ b/lib/webrick/httpresponse.rb @@ -142,7 +142,7 @@ module WEBrick @header.delete('content-length') elsif @header['content-length'].nil? unless @body.is_a?(IO) - @header['content-length'] = @body ? @body.size : 0 + @header['content-length'] = @body ? @body.bytesize : 0 end end @@ -260,10 +260,10 @@ module WEBrick while buf = @body.read(@buffer_size) next if buf.empty? data = "" - data << format("%x", buf.size) << CRLF + data << format("%x", buf.bytesize) << CRLF data << buf << CRLF _write_data(socket, data) - @sent_size += buf.size + @sent_size += buf.bytesize end _write_data(socket, "0#{CRLF}#{CRLF}") else @@ -280,20 +280,20 @@ module WEBrick if @request_method == "HEAD" # do nothing elsif chunked? - remain = body ? @body.size : 0 + remain = body ? @body.bytesize : 0 while buf = @body[@sent_size, @buffer_size] break if buf.empty? data = "" - data << format("%x", buf.size) << CRLF + data << format("%x", buf.bytesize) << CRLF data << buf << CRLF _write_data(socket, data) - @sent_size += buf.size + @sent_size += buf.bytesize end _write_data(socket, "0#{CRLF}#{CRLF}") else - if @body && @body.size > 0 + if @body && @body.bytesize > 0 _write_data(socket, @body) - @sent_size = @body.size + @sent_size = @body.bytesize end end end @@ -302,7 +302,7 @@ module WEBrick while offset > 0 sz = @buffer_size < size ? @buffer_size : size buf = input.read(sz) - offset -= buf.size + offset -= buf.bytesize end if size == 0 @@ -314,7 +314,7 @@ module WEBrick sz = @buffer_size < size ? @buffer_size : size buf = input.read(sz) _write_data(output, buf) - size -= buf.size + size -= buf.bytesize end end end |