瀏覽代碼

* merged the apt--sane-handle-timeout--0 branch

Patches applied:

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--base-0
   tag of apt@packages.debian.org/apt--main--0--patch-87

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-1
   * report timeouts (from Connect) and fail if they happen in pkgAcqMetaSig 

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-2
   * merged with the fixes branch to make it build again

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-3
   * merged with main
Michael Vogt 21 年之前
父節點
當前提交
b19bc330d5
共有 3 個文件被更改,包括 12 次插入1 次删除
  1. 6 0
      apt-pkg/acquire-item.cc
  2. 3 0
      debian/changelog
  3. 3 1
      methods/connect.cc

+ 6 - 0
apt-pkg/acquire-item.cc

@@ -400,6 +400,12 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
    string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
    string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
    unlink(Final.c_str());
    unlink(Final.c_str());
 
 
+   // if we get a timeout if fail
+   if(LookupTag(Message,"FailReason") == "Timeout") {
+      Item::Failed(Message,Cnf);
+      return;
+   }
+
    // queue a pkgAcqMetaIndex with no sigfile
    // queue a pkgAcqMetaIndex with no sigfile
    new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
    new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
 		       "", IndexTargets, MetaIndexParser);
 		       "", IndexTargets, MetaIndexParser);

+ 3 - 0
debian/changelog

@@ -3,6 +3,9 @@ apt (0.6.40.2) unstable; urgency=low
   * improved the support for "error" and "conffile" reporting from
   * improved the support for "error" and "conffile" reporting from
     dpkg, added the format to README.progress-reporting
     dpkg, added the format to README.progress-reporting
   * added README.progress-reporting to the apt-doc package
   * added README.progress-reporting to the apt-doc package
+  * improved the network timeout handling, if a index file from a 
+    sources.list times out, don't try to get the other files from
+    that entry
 
 
  --
  --
 
 

+ 3 - 1
methods/connect.cc

@@ -88,9 +88,11 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
    
    
    /* This implements a timeout for connect by opening the connection
    /* This implements a timeout for connect by opening the connection
       nonblocking */
       nonblocking */
-   if (WaitFd(Fd,true,TimeOut) == false)
+   if (WaitFd(Fd,true,TimeOut) == false) {
+      Owner->SetFailExtraMsg("\nFailReason: Timeout");
       return _error->Error(_("Could not connect to %s:%s (%s), "
       return _error->Error(_("Could not connect to %s:%s (%s), "
 			   "connection timed out"),Host.c_str(),Service,Name);
 			   "connection timed out"),Host.c_str(),Service,Name);
+   }
 
 
    // Check the socket for an error condition
    // Check the socket for an error condition
    unsigned int Err;
    unsigned int Err;