* merged with apt--debian-sid
[ntk/apt.git] / methods / connect.cc
index b85df68..8c2ac6d 100644 (file)
@@ -103,6 +103,8 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
    if (Err != 0)
    {
       errno = Err;
+      if(errno == ECONNREFUSED)
+         Owner->SetFailExtraMsg("\nFailReason: ConnectionRefused");
       return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(),
                           Service,Name);
    }
@@ -166,8 +168,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);
         }