Project

General

Profile

Actions

Bug #6436

closed

Byte counting incorrect in BufferedIO (net/protocol.rb)

Added by jcast (Jeremie Castagna) almost 12 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
1.9
Backport:
[ruby-core:45062]

Description

BufferedIO's @rbuf counts bytes with String#size, but should use String#bytesize. This creates potential incorrect reading of a HTTP body when changing the encoding of each chuck passed by HTTP#read_body:

http.read_body do |chunk|
chunk.force_encoding "UTF-8"
end


Files

protocol.patch (4.39 KB) protocol.patch jcast (Jeremie Castagna), 05/16/2012 05:27 AM
protocol.patch (2.63 KB) protocol.patch nobu (Nobuyoshi Nakada), 05/16/2012 10:05 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0