diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-22 07:36:00 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-22 07:36:00 +0000 |
commit | fbda737eb234f089ba52244d668adf188d69b8f3 (patch) | |
tree | 89801eb158058dcaef552f48779355bfc1d3865d /spec | |
parent | 191292e320011d0c60a1eb3d7b98bc585fa3caa5 (diff) | |
download | ruby-fbda737eb234f089ba52244d668adf188d69b8f3.tar.gz |
lib/net/protocol.rb: account read_bytes before caller sees it
Users may modify the chunk yielded to them in Net::HTTPResponse#read_body.
This will allow users to reduce memory usage by calling
String#clear on the buffer once they're done using it.
* lib/net/protocol.rb (read): increment read_bytes earlier
(read_all): ditto
* test/net/http/test_httpresponse.rb (test_read_body_block_mod): new test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
0 files changed, 0 insertions, 0 deletions