mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
75fcee4a23
commit
877ac7236a
10 changed files with 37 additions and 26 deletions
|
@ -244,7 +244,7 @@ module WEBrick
|
|||
|
||||
def read_request_line(socket)
|
||||
@request_line = read_line(socket, 1024) if socket
|
||||
if @request_line.size >= 1024 and @request_line[-1, 1] != LF
|
||||
if @request_line.bytesize >= 1024 and @request_line[-1, 1] != LF
|
||||
raise HTTPStatus::RequestURITooLarge
|
||||
end
|
||||
@request_time = Time.now
|
||||
|
@ -307,7 +307,7 @@ module WEBrick
|
|||
while @remaining_size > 0
|
||||
sz = [@buffer_size, @remaining_size].min
|
||||
break unless buf = read_data(socket, sz)
|
||||
@remaining_size -= buf.size
|
||||
@remaining_size -= buf.bytesize
|
||||
block.call(buf)
|
||||
end
|
||||
if @remaining_size > 0 && @socket.eof?
|
||||
|
@ -334,7 +334,7 @@ module WEBrick
|
|||
chunk_size, = read_chunk_size(socket)
|
||||
while chunk_size > 0
|
||||
data = read_data(socket, chunk_size) # read chunk-data
|
||||
if data.nil? || data.size != chunk_size
|
||||
if data.nil? || data.bytesize != chunk_size
|
||||
raise BadRequest, "bad chunk data size."
|
||||
end
|
||||
read_line(socket) # skip CRLF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue