| 1104 | |
| 1105 | |
| 1106 | Future<Nothing> DockerFetcherPluginProcess::_urlFetchBlob( |
| 1107 | const string& directory, |
| 1108 | const URI& blobUri, |
| 1109 | const http::Headers& authHeaders, |
| 1110 | vector<string> urls) |
| 1111 | { |
| 1112 | if (urls.empty()) { |
| 1113 | return Failure("Failed to fetch with foreign urls"); |
| 1114 | } |
| 1115 | |
| 1116 | string url = urls.back(); |
| 1117 | urls.pop_back(); |
| 1118 | return download(blobUri, url, directory, authHeaders, stallTimeout) |
| 1119 | .then(defer(self(), [=](int code) -> Future<Nothing> { |
| 1120 | if (code == http::Status::OK) { |
| 1121 | return Nothing(); |
| 1122 | } |
| 1123 | |
| 1124 | LOG(WARNING) << "Unexpected HTTP response '" |
| 1125 | << http::Status::string(code) |
| 1126 | << "' when trying to download blob '" |
| 1127 | << strings::trim(stringify(blobUri)) |
| 1128 | << "' from '" << url |
| 1129 | << "' in schema 2 manifest"; |
| 1130 | |
| 1131 | return _urlFetchBlob(directory, blobUri, authHeaders, urls); |
| 1132 | })); |
| 1133 | } |
| 1134 | #endif |
| 1135 | |
| 1136 | // Tries to obtain URI of the V2 authorization service based on the |