diff options
Diffstat (limited to 'S3.py')
| -rw-r--r-- | S3.py | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -277,7 +277,8 @@ class AWSAuthConnection: | |||
| 277 | except: | 277 | except: |
| 278 | # Sometimes the connection is reset by peer. If that happens | 278 | # Sometimes the connection is reset by peer. If that happens |
| 279 | # just try it again and we'll see what happens. | 279 | # just try it again and we'll see what happens. |
| 280 | connection.request(method, path, data, final_headers) | 280 | connection.close() |
| 281 | continue | ||
| 281 | 282 | ||
| 282 | resp = connection.getresponse() | 283 | resp = connection.getresponse() |
| 283 | if resp.status < 300 or resp.status >= 400: | 284 | if resp.status < 300 or resp.status >= 400: |
| @@ -297,6 +298,7 @@ class AWSAuthConnection: | |||
| 297 | if query: | 298 | if query: |
| 298 | path += "?" + query | 299 | path += "?" + query |
| 299 | # retry with redirect | 300 | # retry with redirect |
| 301 | connection.close() | ||
| 300 | 302 | ||
| 301 | def _add_aws_auth_header(self, headers, method, bucket, key, query_args): | 303 | def _add_aws_auth_header(self, headers, method, bucket, key, query_args): |
| 302 | if not headers.has_key('Date'): | 304 | if not headers.has_key('Date'): |