summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/ftp.cc2
-rw-r--r--methods/http.cc10
2 files changed, 8 insertions, 4 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 8bf8a2ee6..f595e0ca4 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -1102,7 +1102,7 @@ int main(int argc,const char *argv[])
// Run the http method
string Path = flNotFile(argv[0]) + "http";
- execl(Path.c_str(),Path.c_str(),0);
+ execl(Path.c_str(),Path.c_str(),(char *)NULL);
cerr << _("Unable to invoke ") << Path << endl;
exit(100);
}
diff --git a/methods/http.cc b/methods/http.cc
index 81a64d7a3..ba86aa6b6 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -635,9 +635,9 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
and a no-store directive for archives. */
sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n",
Itm->Uri.c_str(),ProperHost.c_str());
- if (_config->FindB("Acquire::http::No-Cache",false) == true)
- strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n");
- else
+ // only generate a cache control header if we actually want to
+ // use a cache
+ if (_config->FindB("Acquire::http::No-Cache",false) == false)
{
if (Itm->IndexFile == true)
sprintf(Buf+strlen(Buf),"Cache-Control: max-age=%u\r\n",
@@ -649,6 +649,10 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
}
}
}
+ // generate a no-cache header if needed
+ if (_config->FindB("Acquire::http::No-Cache",false) == true)
+ strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n");
+
string Req = Buf;