summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/gzip.cc8
-rw-r--r--methods/http.cc2
2 files changed, 9 insertions, 1 deletions
diff --git a/methods/gzip.cc b/methods/gzip.cc
index 809afc0fc..f732c0b86 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -52,6 +52,13 @@ bool GzipMethod::Fetch(FetchItem *Itm)
// Open the source and destination files
FileFd From(Path,FileFd::ReadOnly);
+ // if the file is empty, just rename it and return
+ if(From.Size() == 0)
+ {
+ rename(Path.c_str(), Itm->DestFile.c_str());
+ return true;
+ }
+
int GzOut[2];
if (pipe(GzOut) < 0)
return _error->Errno("pipe",_("Couldn't open pipe for %s"),Prog);
@@ -111,6 +118,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
if (To.Write(Buffer,Count) == false)
{
Failed = true;
+ FromGz.Close();
break;
}
}
diff --git a/methods/http.cc b/methods/http.cc
index cb63ada49..1f3b038bc 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -656,7 +656,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
will glitch HTTP/1.0 proxies because they do not filter it out and
pass it on, HTTP/1.1 says the connection should default to keep alive
and we expect the proxy to do this */
- if (Proxy.empty() == true)
+ if (Proxy.empty() == true || Proxy.Host.empty())
sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
QuoteString(Uri.Path,"~").c_str(),ProperHost.c_str());
else