| 104 | } |
| 105 | |
| 106 | ResponseCode S3InterfaceService::headResponseWithRetries(const string &url, HTTPHeaders &headers, |
| 107 | uint64_t retries) { |
| 108 | string message; |
| 109 | uint64_t retry = retries; |
| 110 | |
| 111 | while (retry--) { |
| 112 | try { |
| 113 | return this->restfulService->head(url, headers); |
| 114 | } catch (S3ConnectionError &e) { |
| 115 | message = e.getMessage(); |
| 116 | if (S3QueryIsAbortInProgress()) { |
| 117 | S3_DIE(S3QueryAbort, "Uploading is interrupted"); |
| 118 | } |
| 119 | |
| 120 | S3WARN("Failed to get a good response in HEAD from '%s', retrying ...", url.c_str()); |
| 121 | } |
| 122 | }; |
| 123 | |
| 124 | S3_DIE(S3FailedAfterRetry, url, retries, message); |
| 125 | } |
| 126 | |
| 127 | Response S3InterfaceService::deleteRequestWithRetries(const string &url, HTTPHeaders &headers, |
| 128 | uint64_t retries) { |