]> git.saurik.com Git - apt.git/commitdiff
Do not remove a not working SrvRecords server twice
authorMichael Vogt <mvo@debian.org>
Tue, 5 Jan 2016 19:49:19 +0000 (20:49 +0100)
committerMichael Vogt <mvo@debian.org>
Tue, 5 Jan 2016 19:49:19 +0000 (20:49 +0100)
The PopFromSrvRecs() already removed the entry from the active
list, so the extra SrvRecords.erase() was incorrect.

Git-Dch: ignore

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)
    {
    // 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;
       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;
    }
 
    return false;