diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-12-14 12:07:24 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-12-14 12:07:24 +0100 |
commit | dc4002d8c3c687e6614d01b34e4b6aa929411ea9 (patch) | |
tree | 8a842af457cfb159741b6c84ee7ab6fc094b88e7 /methods | |
parent | 7570b65d5eae54c51689121a317351a1cd42e64d (diff) | |
parent | 19ec5723caa6ea6ab196a9e960c769ded4ee0d28 (diff) |
* merged with apt--mvo
Diffstat (limited to 'methods')
-rw-r--r-- | methods/gzip.cc | 8 | ||||
-rw-r--r-- | methods/http.cc | 2 |
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 09dab8188..1833f41ef 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -657,7 +657,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 |