#include <algorithm>
+#include "zypp/ZConfig.h"
#include "zypp/base/Logger.h"
#include "zypp/media/MediaMultiCurl.h"
#include "zypp/media/MetaLinkParser.h"
bool userabort = false;
fclose(file);
file = NULL;
+ Pathname failedFile = ZConfig::instance().repoCachePath() / "MultiCurl.failed";
try
{
MetaLinkParser mlp;
bl.reuseBlocks(file, target.asString());
DBG << bl << endl;
}
+ if (bl.haveChecksum(1) && PathInfo(failedFile).isExist())
+ {
+ DBG << "reusing blocks from file " << failedFile << endl;
+ bl.reuseBlocks(file, failedFile.asString());
+ DBG << bl << endl;
+ filesystem::unlink(failedFile);
+ }
Pathname df = deltafile();
if (!df.empty())
{
catch (MediaCurlException &ex)
{
fclose(file);
+ file = NULL;
userabort = ex.errstr() == "User abort";
ZYPP_RETHROW(ex);
}
// something went wrong. fall back to normal download
if (file)
fclose(file);
+ if (PathInfo(destNew).size() >= 63336)
+ {
+ ::unlink(failedFile.asString().c_str());
+ filesystem::hardlinkCopy(destNew, failedFile);
+ }
filesystem::unlink(destNew);
if (userabort)
ZYPP_RETHROW(ex);