Skip to content
This repository has been archived by the owner on Nov 4, 2018. It is now read-only.

Commit

Permalink
* S3/S3.py: Re-upload when Amazon doesn't send ETag
Browse files Browse the repository at this point in the history
  in PUT response. It happens from time to time for
  unknown reasons. Thanks "Burtc" for report and
  "hermzz" for fix. Fixes #1990387



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@204 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information
mludvig committed Jun 30, 2008
1 parent 0471c1d commit 493c072
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2008-06-30 Michal Ludvig <michal@logix.cz>

* S3/S3.py: Re-upload when Amazon doesn't send ETag
in PUT response. It happens from time to time for
unknown reasons. Thanks "Burtc" for report and
"hermzz" for fix.

2008-06-27 Michal Ludvig <michal@logix.cz>

* Released version 0.9.8.1
Expand Down
5 changes: 5 additions & 0 deletions S3/S3.py
Expand Up @@ -381,6 +381,11 @@ def send_file(self, request, file, throttle = 0, retries = 3):
info("Redirected to: %s" % (redir_hostname))
return self.send_file(request, file)

# S3 from time to time doesn't send ETag back in a response :-(
# Force re-upload here.
if not response['headers'].has_key('etag'):
response['headers']['etag'] = ''

debug("MD5 sums: computed=%s, received=%s" % (md5_computed, response["headers"]["etag"]))
if response["headers"]["etag"].strip('"\'') != md5_hash.hexdigest():
warning("MD5 Sums don't match!")
Expand Down

0 comments on commit 493c072

Please sign in to comment.