Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
git-svn-id: https://wush.net/svn/rightscale/right_http_connection/trunk@3894 9f0cbaf6-ce18-0410-ad37-d14a22affa91
  • Loading branch information
David Chia committed May 15, 2008
1 parent bcc2077 commit 8f7f157
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/right_http_connection.rb
Expand Up @@ -332,8 +332,10 @@ def request(request_params, &block)
request.body_stream = request.body
end

# Always make sure that the file pointer is set to point to the beginning of the file
(request.body || request.body_stream).seek(0,IO::SEEK_SET) if request.body || request.body_stream
# Always make sure that the fp is set to point to the beginning of the
# File/IO. Note: socket is a linear stream of bytes -- not seek-able.
# The retry must be handled elsewhere -- higher level.
request.body_stream.pos = 0 if(request.body_stream && (request.body_stream.instance_of?(File) || request.body_stream.instance_of?(IO)))

response = @http.request(request, &block)

Expand Down

0 comments on commit 8f7f157

Please sign in to comment.