mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
Downloader: Remove a possible double call to Callback
This commit is contained in:
parent
918717f3b5
commit
8c4ea7a451
1 changed files with 2 additions and 8 deletions
|
@ -342,15 +342,9 @@ struct CurlDownloader : public Downloader
|
||||||
(httpStatus == 200 || httpStatus == 201 || httpStatus == 204 || httpStatus == 206 || httpStatus == 304 || httpStatus == 226 /* FTP */ || httpStatus == 0 /* other protocol */))
|
(httpStatus == 200 || httpStatus == 201 || httpStatus == 204 || httpStatus == 206 || httpStatus == 304 || httpStatus == 226 /* FTP */ || httpStatus == 0 /* other protocol */))
|
||||||
{
|
{
|
||||||
result.cached = httpStatus == 304;
|
result.cached = httpStatus == 304;
|
||||||
|
act.progress(result.bodySize, result.bodySize);
|
||||||
done = true;
|
done = true;
|
||||||
|
callback(std::move(result));
|
||||||
try {
|
|
||||||
act.progress(result.bodySize, result.bodySize);
|
|
||||||
callback(std::move(result));
|
|
||||||
} catch (...) {
|
|
||||||
done = true;
|
|
||||||
callback.rethrow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue