1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Rescue if IO throws exception on attempted #rewind

This will permit the passing in of pipes, sockets, or other IO objects that
throw exceptions when you call the #rewind method.
This commit is contained in:
Paul Gideon Dann 2014-11-06 15:22:45 +00:00
parent e656f37ae9
commit a052af9a92

View file

@ -44,7 +44,9 @@ module Fog
hash = Fog::AWS::Glacier::TreeHash.new
body.rewind if body.respond_to?(:rewind)
if body.respond_to?(:rewind)
body.rewind rescue nil
end
offset = 0
while (chunk = body.read(multipart_chunk_size)) do
part_hash = hash.add_part(chunk)