]> git.saurik.com Git - apt.git/blobdiff - methods/connect.cc
refactor EDSP classes for better internal reuse
[apt.git] / methods / connect.cc
index cdd97994cc3143f553a84e470677f4ccaa3cb1f6..07a730b887bdfa17f61b91537cd8a4774fb98590 100644 (file)
@@ -288,12 +288,10 @@ bool Connect(std::string Host,int Port,const char *Service,
    // try to connect in the priority order of the srv records
    while(SrvRecords.size() > 0)
    {
+      // PopFromSrvRecs will also remove the server
       Host = PopFromSrvRecs(SrvRecords).target;
       if(ConnectToHostname(Host, Port, Service, DefPort, Fd, TimeOut, Owner))
          return true;
-
-      // we couldn't connect to this one, use the next
-      SrvRecords.erase(SrvRecords.begin());
    }
 
    return false;