diff options
author | Michael Vogt <mvo@debian.org> | 2015-08-20 10:40:45 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2015-08-20 11:41:51 +0200 |
commit | c29dbdffcb6f67812f823f1f844b87320cf6b437 (patch) | |
tree | 41a98cd8af9886a4cf68b68a4034d635b94737b2 /methods | |
parent | 9b70edba6796ebff3935af1cfb5c9bbc98d020b4 (diff) |
Add basic (non weight adjusted) shuffling for SrvRecords selection
Also add "Debug::Acquire::SrvRecs" debug option and the option
"Acquire::EnableSrvRecods" to allow disabling this lookup.
Diffstat (limited to 'methods')
-rw-r--r-- | methods/connect.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/methods/connect.cc b/methods/connect.cc index 9e0f01ee3..5612af6ec 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -272,7 +272,8 @@ bool Connect(std::string Host,int Port,const char *Service, if(LastHost != Host || LastPort != Port) { SrvRecords.clear(); - bool res = GetSrvRecords(Host, DefPort, SrvRecords); + if (_config->FindB("Acquire::EnableSrvRecods", true) == true) + GetSrvRecords(Host, DefPort, SrvRecords); } // we have no SrvRecords for this host, connect right away if(SrvRecords.size() == 0) @@ -282,7 +283,7 @@ 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) { - Host = SrvRecords[0].target; + Host = PopFromSrvRecs(SrvRecords).target; if(ConnectToHostname(Host, Port, Service, DefPort, Fd, TimeOut, Owner)) return true; |