]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-helper.cc
keep trying with next if connection to a SRV host failed
[apt.git] / cmdline / apt-helper.cc
index b92055ab7883e8f024ee781ca71f2e61e71f943a..fd99fba8bb868ee87201c343cd0a1f59709e1ed2 100644 (file)
@@ -39,7 +39,8 @@ static bool DoAutoDetectProxy(CommandLine &CmdL)                      /*{{{*/
    if (CmdL.FileSize() != 2)
       return _error->Error(_("Need one URL as argument"));
    URI ServerURL(CmdL.FileList[1]);
-   AutoDetectProxy(ServerURL);
+   if (AutoDetectProxy(ServerURL) == false)
+      return false;
    std::string SpecificProxy = _config->Find("Acquire::"+ServerURL.Access+"::Proxy::" + ServerURL.Host);
    ioprintf(std::cout, "Using proxy '%s' for URL '%s'\n",
             SpecificProxy.c_str(), std::string(ServerURL).c_str());
@@ -102,7 +103,7 @@ static bool DoSrvLookup(CommandLine &CmdL)                          /*{{{*/
         _error->Error(_("GetSrvRec failed for %s"), name.c_str());
 
       for (SrvRec const &I : srv_records)
-        c1out << I.target << "\t" << I.priority << "\t" << I.weight << "\t" << I.port << std::endl;
+        ioprintf(c1out, "%s\t%d\t%d\t%d\n", I.target.c_str(), I.priority, I.weight, I.port);
    }
    return true;
 }
@@ -199,8 +200,6 @@ static std::vector<aptDispatchWithHelp> GetCommands()                       /*{{{*/
                                                                        /*}}}*/
 int main(int argc,const char *argv[])                                  /*{{{*/
 {
-   InitLocale();
-
    CommandLine CmdL;
    auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_HELPER, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);