summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/file.cc2
-rw-r--r--methods/ftp.cc2
-rw-r--r--methods/https.cc6
-rw-r--r--methods/mirror.cc2
-rw-r--r--methods/server.cc4
5 files changed, 8 insertions, 8 deletions
diff --git a/methods/file.cc b/methods/file.cc
index b689de619..8a087c36d 100644
--- a/methods/file.cc
+++ b/methods/file.cc
@@ -76,7 +76,7 @@ bool FileMethod::Fetch(FetchItem *Itm)
}
}
if (Res.IMSHit != true)
- unlink(Itm->DestFile.c_str());
+ RemoveFile("file", Itm->DestFile);
// See if the file exists
if (stat(File.c_str(),&Buf) == 0)
diff --git a/methods/ftp.cc b/methods/ftp.cc
index d84a194ca..360333107 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -1090,7 +1090,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
// If the file is missing we hard fail and delete the destfile
// otherwise transient fail
if (Missing == true) {
- unlink(FailFile.c_str());
+ RemoveFile("ftp", FailFile);
return false;
}
Fail(true);
diff --git a/methods/https.cc b/methods/https.cc
index a15915910..8d9454545 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -443,7 +443,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
// server says file not modified
if (Server->Result == 304 || curl_condition_unmet == 1)
{
- unlink(File->Name().c_str());
+ RemoveFile("https", File->Name());
Res.IMSHit = true;
Res.LastModified = Itm->LastModified;
Res.Size = 0;
@@ -461,14 +461,14 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
SetFailReason(err);
_error->Error("%i %s", Server->Result, Server->Code);
// unlink, no need keep 401/404 page content in partial/
- unlink(File->Name().c_str());
+ RemoveFile("https", File->Name());
return false;
}
// invalid range-request
if (Server->Result == 416)
{
- unlink(File->Name().c_str());
+ RemoveFile("https", File->Name());
delete File;
Redirect(Itm->Uri);
return true;
diff --git a/methods/mirror.cc b/methods/mirror.cc
index d3aef91bc..56362d317 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -122,7 +122,7 @@ bool MirrorMethod::Clean(string Dir)
}
// nothing found, nuke it
if (I == list.end())
- unlink(Dir->d_name);
+ RemoveFile("mirror", Dir->d_name);
}
closedir(D);
diff --git a/methods/server.cc b/methods/server.cc
index 934ec2abe..650a4aeb8 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -274,7 +274,7 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
// Not Modified
if (Server->Result == 304)
{
- unlink(Queue->DestFile.c_str());
+ RemoveFile("server", Queue->DestFile);
Res.IMSHit = true;
Res.LastModified = Queue->LastModified;
return IMS_HIT;
@@ -350,7 +350,7 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
Server->StartPos = Server->TotalFileSize;
Server->Result = 200;
}
- else if (unlink(Queue->DestFile.c_str()) == 0)
+ else if (RemoveFile("server", Queue->DestFile))
{
NextURI = Queue->Uri;
return TRY_AGAIN_OR_REDIRECT;