summaryrefslogtreecommitdiff
path: root/methods/gzip.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:16 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:16 +0000
commitbe4401bfa4a240bbc894e1bfeb1e1e8d63fc7b18 (patch)
tree3d48bdf9a7abff3b51c02323ea1ed26767d576d7 /methods/gzip.cc
parentf0a53b6301cd1f5d0878f2d6ed21811d70a86f9a (diff)
New http method
Author: jgg Date: 1998-11-01 05:27:29 GMT New http method
Diffstat (limited to 'methods/gzip.cc')
-rw-r--r--methods/gzip.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/methods/gzip.cc b/methods/gzip.cc
index acba7fc52..be4f82e6f 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: gzip.cc,v 1.3 1998/10/30 07:53:53 jgg Exp $
+// $Id: gzip.cc,v 1.4 1998/11/01 05:27:43 jgg Exp $
/* ######################################################################
GZip method - Take a file URI in and decompress it into the target
@@ -23,7 +23,7 @@
class GzipMethod : public pkgAcqMethod
{
- virtual bool Fetch(string Message,URI Get);
+ virtual bool Fetch(FetchItem *Itm);
public:
@@ -33,11 +33,13 @@ class GzipMethod : public pkgAcqMethod
// GzipMethod::Fetch - Decompress the passed URI /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool GzipMethod::Fetch(string Message,URI Get)
+bool GzipMethod::Fetch(FetchItem *Itm)
{
+ URI Get = Itm->Uri;
+
// Open the source and destintation files
FileFd From(Get.Path,FileFd::ReadOnly);
- FileFd To(DestFile,FileFd::WriteEmpty);
+ FileFd To(Itm->DestFile,FileFd::WriteEmpty);
To.EraseOnFailure();
if (_error->PendingError() == true)
return false;
@@ -90,13 +92,13 @@ bool GzipMethod::Fetch(string Message,URI Get)
struct utimbuf TimeBuf;
TimeBuf.actime = Buf.st_atime;
TimeBuf.modtime = Buf.st_mtime;
- if (utime(DestFile.c_str(),&TimeBuf) != 0)
+ if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
return _error->Errno("utime","Failed to set modification time");
// Return a Done response
FetchResult Res;
Res.LastModified = Buf.st_mtime;
- Res.Filename = DestFile;
+ Res.Filename = Itm->DestFile;
URIDone(Res);
return true;