From 24057ad643f91253899a9cd66eaef0b2182f1230 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Jun 2005 13:41:11 +0000 Subject: * report timeouts (from Connect) and fail if they happen in pkgAcqMetaSig --- methods/connect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'methods/connect.cc') 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; -- cgit v1.2.3 From 25182152bc7812fdd56fd40f8b9a04a140079585 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 22 Aug 2005 22:27:56 +0000 Subject: * improve the timeout handling (again) --- methods/connect.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'methods/connect.cc') diff --git a/methods/connect.cc b/methods/connect.cc index b85df6887..4e48927ed 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -166,8 +166,11 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd, } if (Res == EAI_AGAIN) + { + Owner->SetFailExtraMsg("\nFailReason: TmpResolveFailure"); return _error->Error(_("Temporary failure resolving '%s'"), Host.c_str()); + } return _error->Error(_("Something wicked happened resolving '%s:%s' (%i)"), Host.c_str(),ServStr,Res); } -- cgit v1.2.3