Просмотр исходного кода

Doc fixes and copy method patch
Author: jgg
Date: 1999-01-20 04:36:43 GMT
Doc fixes and copy method patch

Arch Librarian лет назад: 22
Родитель
Сommit
91cb4c6b43
3 измененных файлов с 28 добавлено и 19 удалено
  1. 6 3
      doc/apt.conf.5.yo
  2. 20 15
      methods/copy.cc
  3. 2 1
      methods/http.cc

+ 6 - 3
doc/apt.conf.5.yo

@@ -68,7 +68,7 @@ URI handlers.
 startdit()
 startdit()
 dit(bf(Queue-Mode))
 dit(bf(Queue-Mode))
 Queuing mode; bf(Queue-Mode) can be one of bf(host) or bf(access) which 
 Queuing mode; bf(Queue-Mode) can be one of bf(host) or bf(access) which 
-determins how APT parallelizesoutgoing connections. bf(host) means that
+determins how APT parallelizes outgoing connections. bf(host) means that
 one connection per target host will be opened, bf(access) means that one
 one connection per target host will be opened, bf(access) means that one
 connection per URI type will be opened.
 connection per URI type will be opened.
 
 
@@ -82,8 +82,8 @@ will override all settings.
 Three settings are provided for cache control with HTTP/1.1 complient proxy
 Three settings are provided for cache control with HTTP/1.1 complient proxy
 caches. bf(No-Cache) tells the proxy to not used its cached response under
 caches. bf(No-Cache) tells the proxy to not used its cached response under
 any circumstances, bf(Max-Age) is sent only for index files and tells the
 any circumstances, bf(Max-Age) is sent only for index files and tells the
-cache to refresh its object if it is older than the given value. Debian
-updates its index files daily so the default is 1 day. bd(No-Store) 
+cache to refresh its object if it is older than the given number of seconds. 
+Debian updates its index files daily so the default is 1 day. bf(No-Store) 
 specifies that the cache should never store this request, it is only
 specifies that the cache should never store this request, it is only
 set for archive files. This may be usefull to prevent polluting a proxy cache
 set for archive files. This may be usefull to prevent polluting a proxy cache
 with very large .deb files. Note: Squid 2.0.2 does not support any of
 with very large .deb files. Note: Squid 2.0.2 does not support any of
@@ -155,6 +155,9 @@ manpagesection(EXAMPLES)
 bf(/usr/doc/apt/examples/apt.conf) contains a sample configuration file
 bf(/usr/doc/apt/examples/apt.conf) contains a sample configuration file
 showing the default values for all possible options.
 showing the default values for all possible options.
 
 
+mapagesection(FILES)
+/etc/apt/apt.conf
+
 manpageseealso()
 manpageseealso()
 apt-cache (8),
 apt-cache (8),
 apt.conf (5)
 apt.conf (5)

+ 20 - 15
methods/copy.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: copy.cc,v 1.5 1998/11/01 05:27:40 jgg Exp $
+// $Id: copy.cc,v 1.6 1999/01/20 04:36:43 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Copy URI - This method takes a uri like a file: uri and copies it
    Copy URI - This method takes a uri like a file: uri and copies it
@@ -35,28 +35,40 @@ bool CopyMethod::Fetch(FetchItem *Itm)
    URI Get = Itm->Uri;
    URI Get = Itm->Uri;
    string File = Get.Path;
    string File = Get.Path;
 
 
+   // Stat the file and send a start message
+   struct stat Buf;
+   if (stat(File.c_str(),&Buf) != 0)
+      return _error->Errno("stat","Failed to stat");
+
+   // Forumulate a result and send a start message
+   FetchResult Res;
+   Res.Size = Buf.st_size;
+   Res.Filename = Itm->DestFile;
+   Res.LastModified = Buf.st_mtime;
+   Res.IMSHit = false;      
+   URIStart(Res);
+   
    // See if the file exists
    // See if the file exists
    FileFd From(File,FileFd::ReadOnly);
    FileFd From(File,FileFd::ReadOnly);
    FileFd To(Itm->DestFile,FileFd::WriteEmpty);
    FileFd To(Itm->DestFile,FileFd::WriteEmpty);
    To.EraseOnFailure();
    To.EraseOnFailure();
    if (_error->PendingError() == true)
    if (_error->PendingError() == true)
+   {
+      To.OpFail();
       return false;
       return false;
+   }
    
    
    // Copy the file
    // Copy the file
    if (CopyFile(From,To) == false)
    if (CopyFile(From,To) == false)
+   {
+      To.OpFail();
       return false;
       return false;
+   }
 
 
    From.Close();
    From.Close();
    To.Close();
    To.Close();
    
    
    // Transfer the modification times
    // Transfer the modification times
-   struct stat Buf;
-   if (stat(File.c_str(),&Buf) != 0)
-   {
-      To.OpFail();
-      return _error->Errno("stat","Failed to stat");
-   }
-   
    struct utimbuf TimeBuf;
    struct utimbuf TimeBuf;
    TimeBuf.actime = Buf.st_atime;
    TimeBuf.actime = Buf.st_atime;
    TimeBuf.modtime = Buf.st_mtime;
    TimeBuf.modtime = Buf.st_mtime;
@@ -66,13 +78,6 @@ bool CopyMethod::Fetch(FetchItem *Itm)
       return _error->Errno("utime","Failed to set modification time");
       return _error->Errno("utime","Failed to set modification time");
    }
    }
    
    
-   // Forumulate a result
-   FetchResult Res;
-   Res.Size = Buf.st_size;
-   Res.Filename = Itm->DestFile;
-   Res.LastModified = Buf.st_mtime;
-   Res.IMSHit = false;
-   
    URIDone(Res);
    URIDone(Res);
    return true;
    return true;
 }
 }

+ 2 - 1
methods/http.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: http.cc,v 1.21 1999/01/04 00:57:56 jgg Exp $
+// $Id: http.cc,v 1.22 1999/01/20 04:36:43 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    HTTP Aquire Method - This is the HTTP aquire method for APT.
    HTTP Aquire Method - This is the HTTP aquire method for APT.
@@ -875,6 +875,7 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv)
       return 5;
       return 5;
 
 
    FailFile = Queue->DestFile;
    FailFile = Queue->DestFile;
+   FailFile.c_str();   // Make sure we don't do a malloc in the signal handler
    FailFd = File->Fd();
    FailFd = File->Fd();
    FailTime = Srv->Date;
    FailTime = Srv->Date;