Skip to content

Commit

Permalink
Merge pull request #124 from hannesg/fix_response_body_each
Browse files Browse the repository at this point in the history
Use BUFFER_SIZE instead of nil in Response::Body#readpartial
  • Loading branch information
ixti committed Apr 18, 2014
2 parents aabd249 + fcbca6e commit 101a4d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/http/response/body.rb
@@ -1,4 +1,5 @@
require 'forwardable'
require 'http/client'

module HTTP
class Response
Expand All @@ -15,7 +16,7 @@ def initialize(client)
end

# Read up to length bytes, but return any data that's available
def readpartial(length = nil)
def readpartial(length = Client::BUFFER_SIZE)
stream!
@client.readpartial(length)
end
Expand Down

0 comments on commit 101a4d2

Please sign in to comment.