1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 09:19:36 +01:00

after flake rebase

This commit is contained in:
Nikola Knezevic 2020-04-08 14:12:22 +02:00
parent f5095594e7
commit 7867685dcd
5 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,6 @@
#include "fetchers.hh"
#include "cache.hh"
#include "download.hh"
#include "filetransfer.hh"
#include "globals.hh"
#include "store-api.hh"
#include "archive.hh"
@ -36,13 +36,13 @@ DownloadFileResult downloadFile(
if (cached && !cached->expired)
return useCached();
DownloadRequest request(url);
FileTransferRequest request(url);
if (cached)
request.expectedETag = getStrAttr(cached->infoAttrs, "etag");
DownloadResult res;
FileTransferResult res;
try {
res = getDownloader()->download(request);
} catch (DownloadError & e) {
res = getFileTransfer()->download(request);
} catch (FileTransferError & e) {
if (cached) {
warn("%s; using cached version", e.msg());
return useCached();