|
|
|
@ -170,11 +170,13 @@ Error ZarrFunctions::GetChunk(const MString& var, const std::vector<size_t>& chu
|
|
|
|
|
if(!suc) |
|
|
|
|
{ |
|
|
|
|
michlib::message(str + " not found in cache, downloading"); |
|
|
|
|
auto [out, res] = GetUrl(chandle, str); |
|
|
|
|
CURLRAII myhandle; // TODO: remove this workaround of unknown bug
|
|
|
|
|
//auto [out, res] = GetUrl(chandle, str);
|
|
|
|
|
auto [out, res] = GetUrl(myhandle, str); |
|
|
|
|
if(res != CURLE_OK) return Error(pref, MString("can't download chunk: ") + chandle.Err()); |
|
|
|
|
long respcode; |
|
|
|
|
curl_easy_getinfo(chandle, CURLINFO_RESPONSE_CODE, &respcode); |
|
|
|
|
michlib::message("Response: ", respcode); |
|
|
|
|
//curl_easy_getinfo(chandle, CURLINFO_RESPONSE_CODE, &respcode);
|
|
|
|
|
curl_easy_getinfo(myhandle, CURLINFO_RESPONSE_CODE, &respcode); |
|
|
|
|
if(respcode == 403) out = ""; // Failed chunk download mean that this chunk contains only fill
|
|
|
|
|
cache->Put(str, out, 3600); |
|
|
|
|
content = std::move(out); |
|
|
|
|