Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

#125 - fixes redirect bug in file PUT requests

  • Loading branch information...
commit add2d75748dc529bf84240d65eb0fe9ccea155bf 1 parent a86c537
caryp authored
Showing with 12 additions and 10 deletions.
  1. +12 −10 lib/awsbase/right_awsbase.rb
View
22 lib/awsbase/right_awsbase.rb
@@ -1101,19 +1101,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 add2d75

Please sign in to comment.
Something went wrong with that request. Please try again.