summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc6
-rw-r--r--debian/changelog3
-rw-r--r--methods/connect.cc4
3 files changed, 12 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index b2f896627..14acad85a 100644
--- a/apt-pkg/acquire-item.cc
+++ b/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);
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
new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
"", IndexTargets, MetaIndexParser);
diff --git a/debian/changelog b/debian/changelog
index 614041acf..2b4e81595 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ apt (0.6.40.2) unstable; urgency=low
* improved the support for "error" and "conffile" reporting from
dpkg, added the format to README.progress-reporting
* 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
--
diff --git a/methods/connect.cc b/methods/connect.cc
index 981ac1371..b85df6887 100644
--- a/methods/connect.cc
+++ b/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
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), "
"connection timed out"),Host.c_str(),Service,Name);
+ }
// Check the socket for an error condition
unsigned int Err;