Permalink
Browse files

#125 - fixes redirect bug in file PUT requests

(cherry picked from commit add2d75)
  • Loading branch information...
1 parent 740c54f commit f535e13f0323233518d7f0c5b5ba7d11cb60a851 caryp committed Mar 22, 2012
Showing with 12 additions and 10 deletions.
  1. +12 −10 lib/awsbase/right_awsbase.rb
@@ -926,19 +926,21 @@ def check(request) #:nodoc:
sleep @reiteration_delay
@reiteration_delay *= 2
- # Always make sure that the fp is set to point to the beginning(?)
- # of the File/IO. TODO: it assumes that offset is 0, which is bad.
- if(request[:request].body_stream && request[:request].body_stream.respond_to?(:pos))
- begin
- request[:request].body_stream.pos = 0
- rescue Exception => e
- @logger.warn("Retry may fail due to unable to reset the file pointer" +
- " -- #{self.class.name} : #{e.inspect}")
- end
- end
else
@aws.logger.info("##### Retry ##{@retries} is being performed due to a redirect. ####")
end
+
+ # Always make sure that the fp is set to point to the beginning(?)
+ # of the File/IO. TODO: it assumes that offset is 0, which is bad.
+ if(request[:request].body_stream && request[:request].body_stream.respond_to?(:pos))
+ begin
+ request[:request].body_stream.pos = 0
+ rescue Exception => e
+ @logger.warn("Retry may fail due to unable to reset the file pointer" +
+ " -- #{self.class.name} : #{e.inspect}")
+ end
+ end
+
result = @aws.request_info(request, @parser)
else
@aws.logger.warn("##### Ooops, time is over... ####")

0 comments on commit f535e13

Please sign in to comment.